Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

Print:
PDF:

The Topographic Apprentice

Touchy-Feely 3D

Using FindObject and FindPoint

Issue: 1.5 (April/May 2003)
Author: Joe Nastasi
Author Bio: Joe Nastasi has been a programmer since 1977 and a full-time REALbasic consultant since version 1.0. He is also the developer of a spacecraft simulator, A-OK! The Wings of Mercury, which was recently awarded a Cubie for Educational software.
Article Description: No description available.
Article Length (in bytes): 11,911
Starting Page Number: 38
RBD Number: 1520
Resource File(s):

Download Icon 1520.sit Updated: Friday, October 17, 2003 at 12:21 PM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

Last month we discussed techniques for detecting and reacting to collisions between 3D Objects. So much for object-to-object interaction; this month I'll show you how to use the mouse to select and move 3D Objects.

Let's say we want to move the mouse cursor over an RB3DSpace control and display the equivalent location in the 3D scene. Additionally, when the mouse is over an Object3D, we want the name of the Object3D to be displayed near the object. Finally, dragging the Object3D will move it within the scene.

FindPoint

This RB3DSpace method is passed X and Y coordinates that represent a 2D location on the rendered scene drawn by the RB3DSpace control. If this point maps to an Object3D in the scene, a Vector3D which represents the 3D location is returned. NIL is returned if there is no Object3D drawn at the 2D location that is passed.

FindObject

This method is similar to FindPoint except that it returns the Object3D that is drawn at the 2D location by the RB3DSpace control. NIL is returned if the point contains no Object3D.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com