moogal opened this issue on Mar 26, 2013 · 12 posts
moogal posted Tue, 26 March 2013 at 9:22 PM
I'm having a bit of trouble figuring out the point-at function.
One thing that isn't really clear is whether object orientation is important, or if it is based on the objects' relationship when point-at is set. I assumed it was based on the z-axis, but when I try to align props they always seem to flip around unpredictably.
Does point at work with limits/can axes be constrained. For example, could I make a turret that pointed at an airplane with movement on just one axis, and then have its guns point at the airplane with movement only on another axis?
I am trying to have an object always point at the sun, but I do not want it to tilt or roll. Is this even possible?
PhilC posted Tue, 26 March 2013 at 10:35 PM
Point at will align the objects center and end point with the "at" object's center.
The object's center and end point are displayed when you open the joint editor and select "Center" from the top drop down list of options.
Do not think it is possible to constrain an axis.
lesbentley posted Tue, 26 March 2013 at 10:44 PM
What Phil said.
moogal posted Tue, 26 March 2013 at 10:45 PM
But how is the pointing object aligned to the "at" object?
moogal posted Tue, 26 March 2013 at 10:47 PM
I'd hoped to be able to force limits on the axes to constrain them, but no such luck. I guess billboard trees are out also...
lesbentley posted Tue, 26 March 2013 at 11:04 PM
lesbentley posted Tue, 26 March 2013 at 11:18 PM
Quote - I'd hoped to be able to force limits on the axes to constrain them, but no such luck.
Point At overrides most things including limits, and even a locked actor! To the best of my understanding, it is not possible to constrain any axis of rotation in respect to Point At.
ashley9803 posted Wed, 27 March 2013 at 12:23 AM
Oh Phil - love the new avatar, ha ha.
thats all i wanna say
ockham posted Wed, 27 March 2013 at 6:46 AM
Billboard trees will work fine... just move the EndPoint out in front of the tree itself, then set the tree to PointAt your desired camera.
The red cross isn't always visible, so numbers like these in the Joint Editor will do the job...
Edit: Oh, I just realized what you're trying to do. I'll bet you want to constrain the up-down movement while following the camera left-to-right.
I remember a long-ago discussion of this. Seems like somebody, maybe me or maybe not, came up with a partial Python solution.
ockham posted Wed, 27 March 2013 at 7:18 AM
Here's a script that does the job in a basic way. Turns the tree (Yrot only) to face the currently selected camera.
It doesn't require any EndPoint setting; just requires a typical billboard tree. Be sure the tree does NOT have PointAt turned on.
import poser
import math
scene=poser.Scene()
tree=scene.CurrentActor()
cam=scene.CurrentCamera()
scene.DrawAll()
tX,tY,tZ=tree.WorldDisplacement()
cX,cY,cZ=cam.WorldDisplacement()
rads=math.atan2( (cX-tX), (cZ-tZ) )
degs=rads * 180/math.pi
yr=tree.ParameterByCode(poser.kParmCodeYROT)
yr.SetValue(degs)
scene.DrawAll()
moogal posted Wed, 27 March 2013 at 11:32 AM
Thanks so much. There are three things I'd wanted to do with point at, and maybe they are all actually doable in some manner.
Pneumatic pistons. This one seems the easiest, I was going to use two proxy objects at both ends and have both parts of the piston point at each other.
Sun facing solar panel. This seems doable with a script. I am not clear though how point at works with infinite lights since they are defined by a direction rather than a location.
Billboard trees, fire and smoke. Also apparently doable with script.
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()