Fri, Mar 29, 10:59 AM CDT

Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Mar 28 8:52 am)



Subject: Getting the same view from dolly/orbiting cameras


3dcheapskate ( ) posted Fri, 09 May 2014 at 11:20 PM · edited Sun, 24 March 2024 at 8:03 PM

file_504147.jpg

I've read the relevant bits in the Poser 9 Reference Manual (Chapter 11 - Cameras, pages 231-233 specifically), and I **thought** I understood the orbiting cameras.

Until I tried to position the Dolly Camera to get exactly the same view as one of the orbiting cameras...

Starting with a zeroed orbiting camera (Main or Aux, with DollyX/Y/Z and OrbitX/Y/Z all zero) the camera position appears to be about 1.2 Poser units along the positive Z-axis, i.e. at (0,0,1.2), pointing at the origin. The actual distance is not documented anywhere as far as I can tell.

The camera seems to orbit around the origin in a logical manner - e.g. a YOrbit rotation of +90 puts the orbitingcamera at about 1.2 Poser units along the positive X-axis, i.e. at (1.2,0,0).

When I adjust the DollyX/Y/Z position of the orbiting camera it initially looks sensible...

(an the attached screenshot the point of the red ballcone indicates the origin and the point of the green ballcone indicates the MainCam dolly coordinates)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Fri, 09 May 2014 at 11:23 PM

file_504148.jpg

...but when I rotate the camera I get this. The point of the red ballcone (i.e. the world origin) seems to stay in a fixed point in the view, but it's offset from the centre of the view.


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Fri, 09 May 2014 at 11:32 PM · edited Fri, 09 May 2014 at 11:46 PM

I'm trying to work out the maths for a PoserPython script to move the DollyCam to same position/orientation as the Main/Aux cam and  this prompts a couple of questions:

Q1: Does anybody know the exact distance that the orbiting cameras are offset from their centres of rotation (i.e. is it documented anywhere, or do I just go with the best figure I can come up with?)

I can't quite get my head round how the DollyX/Y/Z is affecting the actual camera position. I thought that the DollyX/Y/Z was actually setting the exact centre of rotation, but this is clearly not the case.

Q2: How does the DollyX/Y/Z affect the actual camera position?

(Edit: Poser 6 is exactly the same)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Sat, 10 May 2014 at 12:07 AM · edited Sat, 10 May 2014 at 12:11 AM

file_504149.jpg

Setting DollyCam Yaw=180 I get just about the same viewpoint as the YOrbit=180 MmainCam  if I set the following position:

DollyX = (0.1) * -1

DollyY = (0.2)

DollyZ = (0.3 + 1.2) * -1

I think it's beginning to make sense... the '-1' looks like it'll be a 'cos(YOrbit)'


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



ockham ( ) posted Sat, 10 May 2014 at 4:42 AM

Take a look at my old Posing to Dolly script.  I don't think it's exact, but it might give you a starting point.

 

http://ockhamsbungalow.com/Python/PosingToDolly2.zip

My python page
My ShareCG freebies


PhilC ( ) posted Sat, 10 May 2014 at 5:44 AM

Why do you want to do this?


3dcheapskate ( ) posted Sat, 10 May 2014 at 6:10 AM · edited Sat, 10 May 2014 at 6:11 AM

Quote - Take a look at my old Posing to Dolly script.  I don't think it's exact, but it might give you a starting point. http://ockhamsbungalow.com/Python/PosingToDolly2.zip

Will do, once I'm back on my own computer. I guessed somebody might have already done this.

Quote - Why do you want to do this?

I wondered if anybody would ask! It's to let me get the start/end distances for the atmosphere depth cue. I always find that I'm using the Main or Aux camera when I find the view I want, and unless the nearest/furthest points of the figures/props are close to the centre of the camera view or on the diagonals (i.e. the X-shaped Focus Distance Guide intersects them) I can't judge. And if I adjust the orientation of an orbiting camera to point at the near/far part then the camera moves and the measurement's invalid.

Moving the dolly camera to the position of the orbiting camera I'm using seemed an obvious solution, as I could just adjust Pitch/Yaw to point at the bit I want...


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



lesbentley ( ) posted Sat, 10 May 2014 at 3:00 PM

As far as I can tell, when the Main and Aux cameras are scaled to 100%, they are 1.1 Poser Native Units (PNU), (or approximately 2883.4 mm) in front of (in the positive z direction) the position indicated on their DollyZ dial. My value of 1.1 PNU may not be exact, but should be accurate to within 0.05 PNU. The center of their orbit is this point 1.1 PNU in front of the position indicated on the DollyZ dial.

As far as I know Dolly cameras are at exactly the position shown on the dials.


3dcheapskate ( ) posted Sat, 10 May 2014 at 10:12 PM

Hi Les. What you say about the Main/Aux camera position strengthens my suspicion that the exact distance is undocumented.

But "The center of their orbit is this point 1.1 PNU in front of the position indicated on the DollyZ dial." ?? That doesn't sound right - that's where the camera is! And the main/aux cameras clearly orbit around an external point.

My tests so far seem to indicate that the centre of orbit is actually the world origin (as stated in the Manual!) - so if you rotate +90deg YOrbit the camera will be 1.1 PNU along the positive...and then the resulting point is offset by the DollyX/Y/Z.

I need to do some more tests when I'm back on my own system, but this seems to make some sense.


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Wed, 14 May 2014 at 2:12 AM · edited Wed, 14 May 2014 at 2:17 AM

file_504263.png

After a bit more empirical testing it seems to make sense now. I've attached a quit top-view sketch. So the maths is simple sin/cos trig. For pitch it'll just involve projection onto the YZ plane. And I'm not interested in Roll!

P.S. ockham - I'd never have thought of looking at the camera geometry! And you've got loads of interesting scripts there...


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Tue, 20 May 2014 at 5:24 AM · edited Tue, 20 May 2014 at 5:26 AM

Finally got there. This seems to do what I want

cam = scn.ActorByInternalName("MAIN_CAMERA")  # Could use "AUX_CAMERA" instead
if cam:
    xd=cam.Parameter("dollyX").Value()
    yd=cam.Parameter("dollyY").Value()
    zd=cam.Parameter("dollyZ").Value()
    rx=cam.Parameter("pitch").Value()
    ry=cam.Parameter("yaw").Value()
    
    # Empirically derived offset of camera viewpoint from camera dollyX/Y/Z position
    # (appears to be a fixed value independent of any other camera parameters - same in Poser 6/9)
    Dz = 1.1
    
    # The camera viewpoint position with x/y/zOrbit all zeroed would be...
    x0=xd
    y0=yd
    z0=zd+Dz
    # ...and converting these to polar coordinates
    E0 = todegs(math.atan2(-y0,z0))
    A0 = todegs(math.atan2(x0,z0))
    D0 = math.hypot(y0,math.hypot(x0,z0))
    
    # yOrbit/xOrbit values are simply added to polar azimuth/elevation respectively...
    Ec=E0+rx
    Ac=A0+ry
    if Ec > 90:
        Ec=180-Ec
        Ac+=180
    if Ec < -90:
        Ec=-180+Ec
        Ac+=180
    Dc=D0
    
    # ...and convert back to cartesian. This is where the main camera viewpoint is located
    yc=-Dcmath.sin(torads(Ec))
    d=Dc
math.cos(torads(Ec))
    xc=dmath.sin(torads(Ac))
    zc=d
math.cos(torads(Ac))
    
    # Move Dolly camera to this point
    dcam = scn.ActorByInternalName("STD_CAMERA")
    if dcam:
        dcam.Parameter("dollyX").SetValue(xc)
        dcam.Parameter("dollyY").SetValue(yc)
        dcam.Parameter("dollyZ").SetValue(zc)
        # Dolly camera yaw/pitch are set the same as the Main camera's yOrit/xOrbit
        dcam.Parameter("pitch").SetValue(rx)
        dcam.Parameter("yaw").SetValue(ry)
        dcam.Parameter("roll").SetValue(0.0)

Cheers,

Pete


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Wed, 21 May 2014 at 12:28 AM · edited Wed, 21 May 2014 at 12:36 AM

It's now almost working for the posing/face/hand cameras too - simply by adding the code in orange (using the face camera as an example - using 'hip'/'rHand'/'lHand' the same principle works with posing/hand cameras) I'm getting the dolly camera almost spot-on, but not quite...

I've noticed that the posing/face/hand cameras have additional x/y/zOffset parameters which seem to have very small values (less than 0.1 PNU), and these should probably be factored in somewhere? But I can't find/work out what they represent - anybody know?

Get the mid-point of the relevant bone, which is the centre of rotation

act=fig.ActorByInternalName("head")
ori=act.Origin()
ep=act.EndPoint()
oriX=(ep[0]+ori[0])/2.0
oriY=(ep[1]+ori[1])/2.0
oriZ=(ep[2]+ori[2])/2.0 

cam = scn.ActorByInternalName("FACE_CAMERA")
if cam:
    xd=cam.Parameter("dollyX").Value()
    yd=cam.Parameter("dollyY").Value()
    zd=cam.Parameter("dollyZ").Value()
    rx=cam.Parameter("pitch").Value()
    ry=cam.Parameter("yaw").Value()
    
    # Empirically derived offset of camera viewpoint from camera dollyX/Y/Z position
    # (appears to be a fixed value independent of any other camera parameters - same in Poser 6/9)
    Dz = 1.1
    
    # The camera viewpoint position with x/y/zOrbit all zeroed would be...
    x0=xd
    y0=yd
    z0=zd+Dz
    # ...and converting these to polar coordinates
    E0 = todegs(math.atan2(-y0,z0))
    A0 = todegs(math.atan2(x0,z0))
    D0 = math.hypot(y0,math.hypot(x0,z0))
    
    # yOrbit/xOrbit values are simply added to polar azimuth/elevation respectively...
    Ec=E0+rx
    Ac=A0+ry
    if Ec > 90:
        Ec=180-Ec
        Ac+=180
    if Ec < -90:
        Ec=-180+Ec
        Ac+=180
    Dc=D0
    
    # ...and convert back to cartesian. This is where the main camera viewpoint is located
    yc=-Dcmath.sin(torads(Ec))
    d=Dc
math.cos(torads(Ec))
    xc=dmath.sin(torads(Ac))
    zc=d
math.cos(torads(Ac))

    # xc/yc/zc are wrt the centre of rotation, so add the coordinates of that
    xc+=oriX
    yc+=oriY
    zc+=oriZ
 
    # Move Dolly camera to this point
    dcam = scn.ActorByInternalName("STD_CAMERA")
    if dcam:
        dcam.Parameter("dollyX").SetValue(xc)
        dcam.Parameter("dollyY").SetValue(yc)
        dcam.Parameter("dollyZ").SetValue(zc)
        # Dolly camera yaw/pitch are set the same as the Main camera's yOrit/xOrbit
        dcam.Parameter("pitch").SetValue(rx)
        dcam.Parameter("yaw").SetValue(ry)
        dcam.Parameter("roll").SetValue(0.0)

TIA

Pete


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Wed, 21 May 2014 at 12:58 AM · edited Wed, 21 May 2014 at 1:12 AM

P.S. - it's not just a case of adding/subtracting the x/y/zOffset to/from (x0,y0,z0) or (xc,yc,zc), or adding to the former and subtracting from the latter,or vice versa... I just tried all of those.

I'm rather puzzled by what this x/y/zOffset represents. With the X/Y/Z Dolly/Orbit values set to zero and Michael 3 loaded and zeroed here's the values I ge in X,Y,Z order for the four cameras:

Pose: 0.0, -0.088, 0.0

Face: 0.0, 0.028, 0.0

R Hand: -0.017, -0.006, 0.0

L Hand: 0.017, -0.006, 0.0

*Any ideas?


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Wed, 21 May 2014 at 1:14 AM · edited Wed, 21 May 2014 at 1:27 AM

Hmmm... and the offset values don't seem to change if you alter the camera's Dolly/Orbit X/Y/Z...


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



3dcheapskate ( ) posted Tue, 16 December 2014 at 12:29 AM

Just tried approaching this a different way ( http://www.renderosity.com/mod/forumpro/?thread_id=2886725&page_number=1#msg4184473 ) and the Z offset value I'm getting ties up with the 1.1PNU value that Les Bentley gave earlier in this thread. Re-reading Les' post and my response to it makes me think I'd brainwashed myself! Sorry Les, I think you were right!  :)


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



bagginsbill ( ) posted Tue, 16 December 2014 at 11:12 AM

Why are you computing/reverse engineering? The camera position can be gotten in Python directly. I also automated atmosphere this way.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


3dcheapskate ( ) posted Thu, 18 December 2014 at 1:06 AM · edited Thu, 18 December 2014 at 1:09 AM

Thanks bagginsbill - using poser.Scene().CurrentCamera().WorldDisplacement() as you mentioned in the other thread ( http://www.renderosity.com/mod/forumpro/?thread_id=2886725&page_number=2#msg4184517 ) seems to be exactly what I was after, and much simpler than my Heath-Robinson-esque coding attempts!

But also I'm really trying to understand the 'why' and 'how' of these darn orbiting cameras. Every time I think I understand them they seem to go and do something bizarre. E.g. I had just convinced myself (once again) that the Main/Aux cameras always rotate about the world origin (as per the User Manual, and aRtBee's observations here http://www.book.artbeeweb.nl/?p=3069 under "Camera Type"). But then I loaded a couple of buildings off to one side of the origin - they were the only things in the scene. With DollyX/Y/Z and OrbitX/Y/Z all set to zero the Main camera view was as expected. But when I spun the OrbitY the main camera seemed to rotate about what I guess was the centre of the combined buildings I had in the scene.

I'm sure I recall reading somewhere that the Main/Aux cameras rotate about the centre of the scene (which is usually at or near the world origin) - but can I find the reference? of course I can't...


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



aRtBee ( ) posted Thu, 18 December 2014 at 3:39 AM

suggestion: watch the preview window through the Aux camera. Make the Main cam visible, and start manipulating its Dolly / Orbit settings. Then watch the preview what happens to the main cam. Have fun...

- - - - - 

Usually I'm wrong. But to be effective and efficient, I don't need to be correct or accurate.

visit www.aRtBeeWeb.nl (works) or Missing Manuals (tutorials & reviews) - both need an update though


3dcheapskate ( ) posted Thu, 18 December 2014 at 4:37 AM · edited Thu, 18 December 2014 at 4:39 AM

suggestion: watch the preview window through the Aux camera. Make the Main cam visible, and start manipulating its Dolly / Orbit settings. Then watch the preview what happens to the main cam. Have fun...

Ah !   Watch through the Auxiliary camera !  Just ran Poser and that worked. I've always tried watching through one of the orthogonal cameras (usually Top), and the main camera position in the preview window would never update. After successfully viewing through the Aux camera and seeing the main camera position update correctly,  I switched to the Top camera and got the same problem as beforewhen I moved the main camera - i.e. it didn't update in the preview. And when I switched back to the Aux camera the main camera position doesn't update in the preview window. Poser 9.0.3.23027

These cameras are driving me nuts!


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



aRtBee ( ) posted Thu, 18 December 2014 at 8:18 AM

 okay, I had a second look into it, using Top cam to (pre)view the scene, while having the Main cam selected and visible.

The Main cam is (sort of) parented to an invisible and inaccessibe "main cam helper" object at 0,0,0. Sort of, because actually it's parented to universe which cannot be rotated or alike.

When using xyzOrbit you're actually rotating this parent/helper and the main cam child moves and rotates through the scene accordingly.

When using DollyXYZ you're moving the Main cam relative to it's parent, without rotating. When DollyXYZ=0,0,0  the Main cam is located at XYZ= 0, 0, 1.1 in Poser Native Units

In the meantime, main cam still has the ability to rotate with respect to it's own axes, but there is no dial to make it so directly. You can use the PointAt function instead.  

Note that Aux, Main and Pose cams are meant for helping you building and exploring the scene. Actual shooting is best done using a Dolly cam, as these move freely around, and behave more understandable, especially in animations.

 

- - - - - 

Usually I'm wrong. But to be effective and efficient, I don't need to be correct or accurate.

visit www.aRtBeeWeb.nl (works) or Missing Manuals (tutorials & reviews) - both need an update though


3dcheapskate ( ) posted Thu, 18 December 2014 at 9:30 AM

Just a quick post to carry across the information from the "Focal Length Value For An Exact 90 Degree FOV ?" thread

An exact 12.7mm focal length provides an exact 90° FOV for the dolly camera with all it's scaling values set to 100%.

This 12.7mm figure also seems to provide an exact 90° FOV for the Main and Aux cameras (I ran into problems doing the tests with the Posing/Face/Hand cameras so unable to comment on those)

The actual camera position for the Main/Aux cameras seems to be almost exactly 113.52" along the positive Z axis from the DollyX/Y/Z coordinates.

The OrbitX/Y/Z seem to work as in the image below (I think this corresponds to what aRtBee says in the post above).

file_bf8229696f7a3bb4700cfddef19fa23f.pnWith the Posing/Face/Hand cameras I believe that the Hip/Head/Hand position is used instead of the world origin.

(Of course if you set 'Point At' for any of the cameras that changes things - not sure of the details yet)

Note: I've been getting some situations where the Main camera seems to orbit a point other than than the world origin WITHOUT 'Point At' being set. I get a vague idea that the centre of orbit is somewhere approximating the midpoint of all the props/figures in the scene - but that's just a feeling...


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.

*also available in ShareCG, DeviantArt, DAZ, and CGBytes flavours.



Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.