Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

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