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.

Dark GDK / Select 3D objects the simple way

Author
Message
JasonC
15
Years of Service
User Offline
Joined: 1st Jan 2009
Location:
Posted: 8th Feb 2009 02:52
Hello,

Ok, the issue I am having is when I create a basic sphere, and set its radius to, say, 5, only the center of the object works with dbPickObject(); it does not take into account the actual "object".

I have been trying various things and I cannot seem to get clicking on the object itself, not the center, to work.

I had some luck with vectors:


However, when the camera angle changes the vector calculations change and no longer function like they should.

In other words, when the sim starts, the camera is pointed at object 1 (change x for 1 if you like) and as long as the camera angle stays the same, the cursor, when the mouse is clicked, has x, y and z coords which fall inside the range of the sphere (dbObjectPositionX(1) +/- dbObjectSize(1)). This is what I need, to select an object in real world space. Now, when the camera angle changes, yet the object is still on screen, clicking inside the object no longer matches.

I feel this is due to the direction of the vectors, but I am unsure.

Anyone know an easier way, or how I may remedy my current logic?

Thanks!
JasonC
15
Years of Service
User Offline
Joined: 1st Jan 2009
Location:
Posted: 8th Feb 2009 04:24
Hmm, it would seem I have some errors, display ones i think. I will investigate this further.

I did discovery that dbPickObject DOES work for the entire object not just its center. There are other factors which I am encountering but I wanted to clarify that.

Login to post a reply

Server time is: 2024-09-30 17:19:55
Your offset time is: 2024-09-30 17:19:55