| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Clicking objects? | |
|---|---|
| Tweet Topic Started: Oct 16 2008, 09:51 AM (186 Views) | |
| Damiskaattinen | Oct 16 2008, 09:51 AM Post #1 |
|
Member
![]() ![]() ![]() ![]()
|
I have downloaded that door example, but I can't understand that how to do something (like show message) when you click 3D-object? Please explain that to me and give some code, I can't find it from that example. Thanks in advance. |
![]() |
|
| MysteriXYZ | Oct 16 2008, 03:20 PM Post #2 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
To find out what object is under the mouse cursor at the moment you click, you have to trace a ray from the camera through the cursor and check what object it intersects. The script in this post does this. After calling this script, the variable "selected" will contain the id of the object instance under the cursor and closest to the camera (or "noone" if there's nothing under the cursor). |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)



2:47 AM Jul 11