Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Help with my camera system

Author
Message
JM Studioz
20
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 14th Oct 2004 11:46
I want the camera to follow the player like in Runescape. Where it always is pointing at the player,when you press elft and right it rotates the camera around the player,and when you press up and down the camera's height goes up and down. Heres what i got so far:
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 14th Oct 2004 13:31
Well since you are using functions you either need to set your variables in your function instead of in your loop or declare them as global. I prefer to declare them global.
I added :
global ca#=camera angle y()
global ch#=10
global x1#
global y1#
global z1#
above the loop
secondly I moved the commands that follow and point to the object to run after you edit the camera values. I just put them at the end of the function (this is just what I prefer to do).

Some of your variable declarations were in your loop so it kept resetting them. So when you edit them in your function they just reset and then it updates. I moved those above the main loop.

I also increased the matrix size, just so it would be easier to see the camera move.

The final source is here

This works with DBPro. If you are using DBC then you need to make the variables as arrays thus making them global.

Aku Soku Zan
JM Studioz
20
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 14th Oct 2004 21:46
Hey,thanks alot! Yeah now I understand what I did.

Login to post a reply

Server time is: 2024-11-27 12:58:53
Your offset time is: 2024-11-27 12:58:53