<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Light</id>
	<title>Light - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Light"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Light&amp;action=history"/>
	<updated>2026-06-15T05:48:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Light&amp;diff=8057&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Light&amp;diff=8057&amp;oldid=prev"/>
		<updated>2014-03-28T02:16:30Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Overview =&lt;br /&gt;
Lighting is important for high-quality shots. PyMOL supports of up to 10 virtual lights.  You can turn the lights on/off and also position them where you want (behind the camera).&lt;br /&gt;
&lt;br /&gt;
Light2..Light9 control where the other lights go.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:L1.png|Normal lighting&lt;br /&gt;
Image:L2.png|Light1 moved a bit.  Notice how the shadows have changed.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# set the light to some position.  The 'position'&lt;br /&gt;
# must be a vector specifying the XYZ location&lt;br /&gt;
# to put the light.&lt;br /&gt;
set light, position&lt;br /&gt;
&lt;br /&gt;
# for example&lt;br /&gt;
set light, [ -0.55, -0.70, 0.15 ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= User Hint = &lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Ll.gif|Moving lights make for a cool effect; you can make this look better by smoothing out the distances and ranges.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;:&lt;br /&gt;
One neat trick, for rendering a &amp;quot;sunset&amp;quot; on your protein is to turn off all the lights, then render the scene as you move the light across the scene.  The shadows move across the protein based on the light position and it looks like the sun is setting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Code ==&lt;br /&gt;
Here's the code for the animated GIF shown above.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
python&lt;br /&gt;
cmd.set(&amp;quot;light&amp;quot;, ll)&lt;br /&gt;
for x in range(10):&lt;br /&gt;
        l = [ -0.4 + 2*float(x/10.), -0.4, -1  ]&lt;br /&gt;
        print l&lt;br /&gt;
        cmd.set(&amp;quot;light&amp;quot;, l)&lt;br /&gt;
        cmd.ray()&lt;br /&gt;
        cmd.png(&amp;quot;lll&amp;quot; + str(x) + &amp;quot;.png&amp;quot; )&lt;br /&gt;
for x in range(10):&lt;br /&gt;
        l[0] -= 2*float(x/10.)&lt;br /&gt;
        print l&lt;br /&gt;
        cmd.set(&amp;quot;light&amp;quot;, l)&lt;br /&gt;
        cmd.ray()&lt;br /&gt;
        cmd.png(&amp;quot;llll&amp;quot; + str(x) + &amp;quot;.png&amp;quot; )&lt;br /&gt;
python end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then, in the shell do&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
convert lll* llll* light_movie.gif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
[[Ray]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Lighting]]&lt;br /&gt;
[[Category:Representations|Lighting]]&lt;br /&gt;
[[Category:Settings]]&lt;/div&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
</feed>