Camera above/behind ship

Blitz3D Forums/Blitz3D Beginners Area/Camera above/behind ship

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Number of ways of doing this. A really simple method would be to create the spaceship model, create a camera, (both at the same coordinates and pointing the same wa) then move the camera a certain distance backwards and up before using the aligntovector command to point the camera at the ship and then making the camera a child of the ship using the entityparent command.

Or you can do the whole thing without parenting the camera to the ship by simply updating the camera's position and orientation each frame. If you want it to move smoothly from one point to another a method like this may work:

as some basic 'pseudocode' it is here:

translateentity camera,smallvalue#*(desiredcamerax#-entityx(camera)),smallvalue#*(desiredcameray#-entityy(camera)),smallvalue#*(desiredcameraz#-entityz(camera))

aligntovector camera,desiredcameraviewpointx#-entityx(camera),desiredcameraviewpointy#-entityy(camera),desiredcameraviewpointz#-entityz(camera),3,smallvalue#


some code similar to the stuff above called each frame should work...