From: DeLano, W. <wa...@su...> - 2002-04-12 18:47:08
|
Robert, You are on the right track. In order to do this right, you'll need = to use PovRay, which supports perspective and textures. =20 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. =20 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. =20 Cheers, Warren from pymol.cgo import * obj =3D [ 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:wa...@su... Warren L. DeLano, Ph.D. > -----Original Message----- > From: Robert Campbell [mailto:rl...@k2...] > Sent: Friday, April 12, 2002 9:52 AM > To: PyM...@li... > Subject: [PyMOL] Fancy images >=20 >=20 > Hi, >=20 > Someone posed a question to me that I couldn't answer, so I'm=20 > turning to > the collective wisdom here for help. >=20 > 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=20 > simple image > of this sort on the opening page of the pymol gallery, so I=20 > figure this > must be possible and that perhaps Warren himself knows. :) >=20 > I assume that this might be a povray method, so I figured out=20 > that if do > something like: >=20 > (header,data) =3D cmd.get_povray() > file=3Dopen('povray.dat','w') > file.write(header) > file.write(data) > file.close() >=20 > then I have a povray input file that I can render. >=20 > Does anybody have a recipe for adding a background image using povray? > Or is there another, better way? >=20 > Cheers, > Robert > --=20 > Robert L. Campbell, Ph.D. =20 > http://biophysics.med.jhmi.edu/rlc > rl...@k2... phone:=20 > 410-614-6313 > Research Specialist/X-ray Facility Manager > HHMI/Dept. of Biophysics & Biophysical Chem., The Johns=20 > Hopkins University > PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5=20 > F635 C0E2 >=20 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users >=20 |