POV-Ray : Newsgroups : povray.newusers : Text on a sphere : Re: Text on a sphere Server Time
3 Sep 2024 06:15:31 EDT (-0400)
  Re: Text on a sphere  
From: Mike Raiford
Date: 15 Feb 2005 11:21:50
Message: <4212219e$1@news.povray.org>
Desreux wrote:
> Being a chemist, I often draw molecules as balls and sticks of various
> colors. The files containing x,y,z coordinates and information on the
> colors, size, nature of the atoms and bonds. These files  are converted in
> PovRay to obtain quite nice drawings (for instance with a program called
> Mol2mol but there are many others). Sometimes, I have to produce plots with
> a white background and with atoms in different tones of gray. If the
> molecules contain many different atoms, it's no longer easy to distinguish
> them and I would like to add the appropriate chemical symbol on some of the
> atoms. The letters would have to follow the curvature of spheres of
> different sizes and be partly hidden by atoms that are closer to the viewer
> if need be. The PovRay files I use give a list of atoms with the
> characteristics of each of them. I guess I should add something there to
> get what I want but being quite inexperienced in Povray, I don't know how
> to proceed. Could someone help me (as I did not find what I was looking for
> on the web). Thanks a lot. Jean F.

This should get you what you want:

There is an assumption that this fits on a unit sphere centered at 0, 
so, use scaling instead of setting the sphere's radius, Also- depending 
on the font you choose, you may have to fiddle with scaling, 
translations and rotations.

sphere {
     0,1
     pigment {
         object {
            text { ttf "arial.ttf" "He",1,0 scale <.15,.25,100> 
translate <0,.40,-1> }

         red 1
         rgb 1
         }

         warp { spherical dist_exp 0}
         rotate y*117
     }
}


-- 
~Mike

Things! Billions of them!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.