|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
>
>
>
An alternative would be to approximate a sphere by a set of bicubic
patches and use UV mapping. It depends a bit if you only want text
on it (use another e.g. Mike's approach) or if you want to have
also symbols or bands of color or ... on it.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
andrel wrote:
> 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.
>>
>>
>>
> An alternative would be to approximate a sphere by a set of bicubic
> patches and use UV mapping. It depends a bit if you only want text
> on it (use another e.g. Mike's approach) or if you want to have
> also symbols or bands of color or ... on it.
Actually, no, that is too complicated. You can simply put a image_map
on a sphere.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|