Follow the camera

Blitz3D Forums/Blitz3D Beginners Area/Follow the camera

SkyCube(Posted 2006) [#1]
Hello everyone,

I am trying to create a camera-follows-the-player type setting. I have tried using a pivot as a parent for the player and camera, but it doesn't work quite right. I haven't been able to pin down the problem, but it seems to be a problem with the entities collision settings. I just wanted to ask, has anyone done something like this and has code for it they wouldn't mind sharing? Short of using pure trigonometry, I have no idea how to go about this, but before I delve into sines and cosines, I wonder if anyone has any code for this. I checked in the archives, but didn't find anything.

Can anyone help?


Floyd(Posted 2006) [#2]
Look at the castle demo that comes with Blitz3D. You will find it in the \mak folder in the Blitz3D samples.

The camera code might be more complicated than you want, but its a good start.


puki(Posted 2006) [#3]
http://www.blitzbasic.com/codearcs/codearcs.php?code=1083

http://www.blitzbasic.com/codearcs/codearcs.php?code=584

http://www.blitzbasic.com/codearcs/codearcs.php?code=97


SkyCube(Posted 2006) [#4]
Thanks for both your replies, this should get me started. The castle example was of great help.