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 / i need help with moveing a 3d object on a matrix

Author
Message
wyteboi
20
Years of Service
User Offline
Joined: 14th May 2005
Location: Anaheim, Cali
Posted: 15th May 2005 08:04
ok i read sum1 elses post and i found that u can easily move some 3d object with a mouse...but thats not exactly wut i need...i dunno if this is posted up sumwhere else but i need help selecting a 3d object..more than actually just moving it around....like lets say i have two spheres on a matrix on the screen i want to sumhow select a sphere....then click anywhere on the screen to unselect it...then click on the other sphere and select that one....if u cud help me out .....i wud be so happy
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 16th May 2005 19:13
try messig around with


please reply
TDBoy
21
Years of Service
User Offline
Joined: 29th Feb 2004
Location:
Posted: 17th May 2005 14:10
You could try using the Object Screen() commands as Link said, coupled with the Object Size() commands. Obviously you'd have to factor in some distance formula, so as the objects move closer and farther, the "clickable" zone would resize appropriately. Pseudo code below buddy =] Keep in mind that it doesn't really take into account if the object is rotated and if the camera isn't directly facing the object. And the Object Screen() commands will return a variable even if the object is off-screen. Hope this helps!

The Life and Times of Semtex...
Relativity
20
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 18th May 2005 09:23
Here's a program I wrote to show you what's going on. It still has some bugs but it should give you the idea. The equation the top refers to is

Distance * 2D Radius = K

2D radius is how big the 3d object is on your screen from the center of the object. I used my mouse position to calculate this. Here's the program:



Hope it helps.

"It's against my programming to impersonate a deity!"~C-3P0
wyteboi
20
Years of Service
User Offline
Joined: 14th May 2005
Location: Anaheim, Cali
Posted: 18th May 2005 10:06
thanx a lot guys i kinda knew all this a lil bit alredy i just needed confirmation on wut i was doing was right

Login to post a reply

Server time is: 2025-05-23 02:33:49
Your offset time is: 2025-05-23 02:33:49