TGC Codebase Backup



Easiest 3rd Person View! by w33dless

29th May 2006 20:28
Summary

Easy 3rd person view function



Description

This function was used for a car racing game, so you might want to lower/raise the increments of the Z, and Y axis'

This function does not face the camera in the same direction as your object, but if you would like to do so in your near future of your project do not use this code. A camera facing the same direction as your object will use your angle and the cameras angle and trig, along with the curveangle function in DBPro. Thanks.


Example use of this function:

3rdPersonView(1, 10, 15)

This says that the object number is one, and you want it to be 10 (Whatever measurement DBPro measures in) away, and 15 (Whatever measurement DBPro measures in) above your object.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Function 3rdPersonView(obj, distAway#, distAbove#)
Position Camera 0, Object Position X(obj), Object Position Y(obj)+distAbove#, Object Position Z(obj)-distAway#
Point Camera 0, Object Position X(obj), Object Position Y(obj) +distAbove#, Object Position Z(obj)
EndFunction