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 / which is better, doing 3d maths or using pick object

Author
Message
Death_fox
14
Years of Service
User Offline
Joined: 18th Apr 2012
Location:
Posted: 23rd Nov 2012 16:06
i'm building a game that consists of blocks, something like minecraft, would it be better to use 3d maths to work out what block the mouse is on or just to use pickobject function?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Nov 2012 18:20
Neither. Your cursor is always in the centre of the screen, but your mouse may not be depending on how you handle your camera.

I suggest using a raycast in the direction the camera is looking. Sparky's has a good command for that, and it returns the object it's colliding with. Plus, you have control of the reach distance using this method.



Can someone double check my maths?

TheComet

Login to post a reply

Server time is: 2026-07-08 08:31:09
Your offset time is: 2026-07-08 08:31:09