Robert,
You are on the right track. In order to do this right, you'll need to use
PovRay, which supports perspective and textures.
PyMOL's raytracer is really just an optimized orthographic, textureless,
reflectionless raycaster, which is fine for simple molecules, but inadequate
for complex scenes. In other words, to make a Science or Nature cover image,
you will have to do a bit more work than just hitting the "Ray" button.
Specifically, you need to introduce a geometric object behind the molecule
onto which the shadow can be cast. If all you need is a flat, untextured
surface, then you can use PyMOL's CGO module to generate this. Otherwise,
you'll need to learn how to modify PyMOL's PovRay input file to contain these
objects by reading the PovRay documentation and editing the text file you
already know how to generate.
I've attached an example below. Save to "ray.py" and run it from within
PyMOL.
Cheers,
Warren
from pymol.cgo import *
obj = [
BEGIN, TRIANGLE_STRIP,
COLOR, 0.8,0.7,0.4,
NORMAL, 0.0, 1.0, 0.0,
VERTEX, -7.0, -20.0, 0.0,
VERTEX, -10.0, -20.0, 30.0,
VERTEX, 12.0, -20.0, 0.0,
VERTEX, 15.0, -20.0, 30.0,
END,
]
cmd.load_cgo(obj,"plane")
cmd.load("$PYMOL_PATH/test/dat/pept.pdb")
util.ray_shadows('heavy')
cmd.set_view((\
0.962451875, -0.074250713, -0.261098653,\
0.192369312, 0.865197897, 0.463061303,\
0.191519246, -0.495900899, 0.846994936,\
-0.427299917, 0.681541085, -83.549995422,\
1.224037170, -10.279197693, 20.545440674,\
70.968811035, 117.627342224, 0.000000000 ))
cmd.ray()
--
mailto:[email protected]
Warren L. DeLano, Ph.D.
> -----Original Message-----
> From: Robert Campbell [mailto:[email protected]]
> Sent: Friday, April 12, 2002 9:52 AM
> To: [email protected]
> Subject: [PyMOL] Fancy images
>
>
> Hi,
>
> Someone posed a question to me that I couldn't answer, so I'm
> turning to
> the collective wisdom here for help.
>
> How does one create one of those fancy journal-cover images in which,
> say, a structure is superimposed on some other image as a background,
> but in which a shadow is cast on the background. There is a
> simple image
> of this sort on the opening page of the pymol gallery, so I
> figure this
> must be possible and that perhaps Warren himself knows. :)
>
> I assume that this might be a povray method, so I figured out
> that if do
> something like:
>
> (header,data) = cmd.get_povray()
> file=open('povray.dat','w')
> file.write(header)
> file.write(data)
> file.close()
>
> then I have a povray input file that I can render.
>
> Does anybody have a recipe for adding a background image using povray?
> Or is there another, better way?
>
> Cheers,
> Robert
> --
> Robert L. Campbell, Ph.D.
> http://biophysics.med.jhmi.edu/rlc
> [email protected] phone:
> 410-614-6313
> Research Specialist/X-ray Facility Manager
> HHMI/Dept. of Biophysics & Biophysical Chem., The Johns
> Hopkins University
> PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5
> F635 C0E2
>
> _______________________________________________
> PyMOL-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pymol-users
>