moogal opened this issue on Mar 26, 2013 · 12 posts
ockham posted Wed, 27 March 2013 at 1:04 PM
On pneumatic pistons: Yes, that's a trick that works nicely. I've done it before.
A similar script would serve for the solar panels, assuming they have one pivot direction. Use a point light for the sun so it will have a known location. Here's how it might read, assuming the sun is "Light 1" and assuming the panels can rotate only on X:
import poser
import math
scene=poser.Scene()
panel=scene.CurrentActor()
sun=scene.Actor('Light 1')
scene.DrawAll()
pX,pY,pZ=panel.WorldDisplacement()
sX,sY,sZ=sun.WorldDisplacement()
rads=math.atan2( (sY-pY), (sZ-pZ) )
degs=rads * 180/math.pi
xr=panel.ParameterByCode(poser.kParmCodeXROT)
xr.SetValue(degs)
scene.DrawAll()