there you go....lookat is the point which your camera has to target.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
204 'class irr::core::matrix4' has no member named 'transformVector'
maby i explaned it wrong?
i just need to find how to work out the position that is x units infront of the car.. then i can position the camera, attach it to the car and then use LookAt to make the camera look infront of the car..
dude my last post is doing what u want....the only thing it didn't handel was positioning the camera...but i thought u could do that on your own.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
but still, my camera is allways looking at the center of the world.. even when i move my camera or set another lookat function it still looks at the center of the world...
you never explaned what the parts of your code do.. could you explain them?
core::vector3df fore(0, 0, 10);
// rotate so it points in the direction the car is facing
car->getAbsoluteTransformation().rotateVect(fore);
// add the camera position, so fore is 10 units in front of the camera
fore += camera->getAbsolutePosition();
// set the target
camera->setTarget(fore);
Last edited by vitek on Tue Jan 30, 2007 6:31 pm, edited 1 time in total.
Not sure what you mean when you say it doesn't 'follow' your car. The camera should be a child of the car. It is my understanding that your newton callbacks should be used to update the position and rotation of the car. Are you doing that?