Direct3d (getting camera to follow)

Started by
0 comments, last by Scooter 23 years, 8 months ago
Hey what''s the correct way to get the camera to follow behind an object? I''ve tried this but the orientation is wrong: D3DVECTOR dir; myglobs.camera->LookAt(theship, NULL, D3DRMCONSTRAIN_Z); // this is what moves theship theship->SetPosition(theship,D3DVAL(0), D3DVAL(0), D3DVAL(.9)); theship->GetPosition(myglobs.scene,&dir); //supposed to keep the camera 5 from back of ship myglobs.camera->SetPosition(myglobs.scene,dir.x,dir.y,dir.z - 5);
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
Advertisement
Can you store object movement in a matrix and then just apply the same matrix to the camera? This should work for any transformations, including rotation, assuming your object transformations are done in object space. If not, you''ll have to convert them.

GDNet+. It's only $5 a month. You know you want it.

This topic is closed to new replies.

Advertisement