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.

DarkBASIC Professional Discussion / camera and object movement problem

Author
Message
Derekioh
17
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 21st Aug 2011 01:05
So my object moves by velocity variables, and my camera is like a first person shooter. My problem is my character only moves in one set of directions, and so when I turn my camera, when i try to move forward it still only moves in the first set of directions, as oppose to correcting itself. I know there is a bit of math involved (like sin and cos) but I was wondering if someone could give me a coding example or an explanation on how to do it.

Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 21st Aug 2011 01:14
The simplest way is likely this. No sin and cos even needed (although DBPro does it internally).

Of course there are better ways, but this is easy to understand and good for starters.
Derekioh
17
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 21st Aug 2011 01:20
first off, thanks for the quick response. secondly, I have used that before (up until now actually), but I wanted to learn the way of doing it without it. I want to learn how to code some things myself now, not just use a command for everything. But thank you very much Bluespark.

Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 21st Aug 2011 02:23
Try this:
Derekioh
17
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 21st Aug 2011 02:30
okay, will do! I'll try it out real quick and get back to you

Derekioh
17
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 21st Aug 2011 03:20
well it doesn't quite work, but i have the idea so thank Bluespark!

Login to post a reply

Server time is: 2026-07-10 15:31:52
Your offset time is: 2026-07-10 15:31:52