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 Discussion / change screen position to 3d coordinates

Author
Message
khosh
19
Years of Service
User Offline
Joined: 6th Aug 2005
Location:
Posted: 6th Aug 2005 09:43
i want to create a simple demo similar The sims.
i find a command in darkbasic that call screen coordinates of a object. with this command i can select a object on 3d world by mouse!
now i wish move the object. for example when click in a screen position(only return x and y of mouse) object walk to that position(require x,y,z 3d world), like The Sims!
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 6th Aug 2005 10:10 Edited at: 6th Aug 2005 10:12
khosh,

For this, you will need to learn something, not much, about vector math. It is not a subject I have touched on. However, maybe someone else will give us their knowledge on it. The post 3d mouse - for any camera angle! within the Code Snippets board, might also help you. If so-be you have the Nuclear Glory DLL, and DarkBasic Enhanced version. Good luck.


+NanoBrain+
khosh
19
Years of Service
User Offline
Joined: 6th Aug 2005
Location:
Posted: 6th Aug 2005 10:36
tanks for your reply,
i haven't DarkBasic Enhanced version.
do you know such this code in dbpro?

again and again tanks
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 6th Aug 2005 22:29
in DB pro we have pick object, that allows you to select objects despite them being hidden or not, so you could fill the map with hidden cubes and use pick object to detect the position you clicked on, the other way would be to do like some commercial games do and just use a marker inside the 3d world to select a location, (plus this examples much easier than doing a pick object )



in this case you move the marker around the matrix and whenever you press space a sphere is dropped at that position, this was written in pro but should work in classic btw, you could use the same system to get the markers position (x# and z#) and then use that to get the effect you want instead, you don`t have to use the arrowkeys either, you could move the marker with the mouse if you wish, just an idea.

Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 7th Aug 2005 11:25
Here is the version using the mouse.


The happenings of tommorow are behind us now
khosh
19
Years of Service
User Offline
Joined: 6th Aug 2005
Location:
Posted: 7th Aug 2005 13:11
this is best way...
NanoBrain,Me!,Robot, tanks
khosh
19
Years of Service
User Offline
Joined: 6th Aug 2005
Location:
Posted: 8th Aug 2005 14:24
what's your idea about changes?
by left click on object , select and darg.
by right click disseat object!

Login to post a reply

Server time is: 2025-05-22 12:49:24
Your offset time is: 2025-05-22 12:49:24