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 / Mastering movement, or: camera woes

Author
Message
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 4th Mar 2012 13:56
Hi all,

following my last post regarding step-by-step movement in a 3D matrix, I would like to ask for your advice once more.

I'm trying to get to grips with controlling the camera: the code in my example creates a matrix in which a user can move forwards, backwards and sideways by pressing the WASD or arrow-keys. However, the user can also rotate the camera by pressing Q, E or Home and PgUp.

This last part is causing me trouble: I'd like the camera to move fore- & backwards etc. in the direction it is facing when a user has rotated it. In the example provided, the camera is merely re-positioned along the z and x axis. Clearly I'm missing something here... but what? <ponders>

Quisco DaLuse
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 4th Mar 2012 22:23
You can use the NEWXVALUE and NEWZVALUE commands for movement or you can use the camera movement commands, like this:


Also, you need to actually turn SYNC on to keep it from flickering. You set a SYNC RATE without turning it on.
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 5th Mar 2012 19:16
Wow, that is extremely elegant!

After posting, I created a program that inserted a hidden object and let the camera follow it. This is definitely a nicer solution... I am - once more - in your debt

Ah, and thanks for the 'sync on'-remark. I was wondering why my other stuff does sync and this test didn't!
Quisco DaLuse
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 5th Mar 2012 19:48
okay great, good luck to you.

Login to post a reply

Server time is: 2024-11-22 06:39:53
Your offset time is: 2024-11-22 06:39:53