April 28, 2024, 12:31:28 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


math question

Started by J B Wood (Zumwalt), July 31, 2006, 09:03:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

I am horrible at math but here is the problem.

I have the coordinates of the tank, I have the coordinates of the camera since there based on the tank and offset (camera is now behind tank)
I have the direction the tank is facing and have placed the camera behind the tank and up a little.
Now, I need to build in a chase camera routine, so this takes some math skill I don't have at 11pm.
Based on the direction the tank is facing, assume that the direction needs to be the same for the camera, now for the twist, as the tank rotates, the camera needs to remain behind the tank, in essance face the same direction all the time the tank is.

This is just problem 1, next problem I have to churn through is when I move the tank if I turn my forward motion is change to the new direction the tank is facing, and right now I am to tired to figure it out. Anyone got a bone they can throw me on this? If not its cool, I'll figure it out eventually.

I ran into a problem of adding a child to an 3dobject, it doesn't render, so it has to be a child of the scene not of the 3dobject.
I would rather it be a child of the object and not of the scene.

z = my tank.
sp = my single cannon
z.addchild(sp); = does not render
c is my camera so c.addchild(sp); renders cannon

I want to just do
z.addchild(sp);
c.addchild(z);
and have them both render

If I add a c.addchild(sp) with z.addchild(sp) it bombs on me when exiting the build.

chaos I tell you, my mind is chaos!