Macromedia Director + Shockwave 3D: Camera Positioning Problem?
September 30th, 2009 | by admin |I have an object that is moving in the 3D space in X and Z direction (Y stays constant). I want to position the camera above it, looking downwards so that the object always appears in the center of the screen.
The code below is not working correctly. The camera is moving in the opposite direction. What am I doing wrong?
pos_x = member("scene") .model("object") .getWorldTransform() .position.x
pos_z = member("scene") .model("object") .getWorldTransform() .position.z
member("scene") .cameraPosition = vector(pos_x, 200, pos_z)
member("scene") .cameraRotation = vector(-90, 0, 0)
Thanks.
What do you mean by opposite direction? And where are you moving it, you must have some keyboard handler code to do that. Without that I can’t tell what’s going wrong.
Here’s a little tip though: I don’t know how your camera class works internally, but usually in 3D it’s best to rotate first at the origin, and then translate it to world space.
One Response to “Macromedia Director + Shockwave 3D: Camera Positioning Problem?”
By Pfo on Sep 30, 2009 | Reply
What do you mean by opposite direction? And where are you moving it, you must have some keyboard handler code to do that. Without that I can’t tell what’s going wrong.
Here’s a little tip though: I don’t know how your camera class works internally, but usually in 3D it’s best to rotate first at the origin, and then translate it to world space.
References :