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.

Code Snippets / Position object on the X/Z plane at position represented by mouse cursor with ability to move camera in every direction

Author
Message
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2004 16:39
This is DBPro code. It has been tested by me and it works. It is basically a revision of the code previously posted at: http://darkbasicpro.thegamecreators.com/?m=forum_view&t=27469&b=6 and http://darkbasicpro.thegamecreators.com/?m=forum_view&t=27455&b=7

As both Red Eye and GuruSY asked for the ability to pitch the camera up and down I've revised my previous code to do achieve that. For good measure I've also included some code to spin the camera's lens and also you can now move the camera up and down on the Y axis. So basically it now does everything anybody could ever ask for in an isometric style game. I've also significantly expanded the rem statements - I hope that will be helpful.

I'll put the code into the codebase as well.

Two remaining issues:

1. the first time you use the pitch or roll keys the camera will "jump". This is a known DBPro bug I'm afraid - first reported by Spooky. Lee says he will fix it in U6

2. if the mouse cursor is "above" the plane of the matrix then the red cube will vanish into infinity. If you want to stop this just include some if statements around the position object 2 command in the function so that object 2 will not be positioned if the X and Z values are greater than the size of the matrix (-500 to +500)

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home

Login to post a reply

Server time is: 2024-11-23 21:21:55
Your offset time is: 2024-11-23 21:21:55