The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by siu98oad]

How do I 'extract' the coordinates of a live scene?

My program works correctly - it loads in a scene. When the scene is live, I
need access to the coordinates of the scene. How do I achieve this?

Uzo
import-bot (20211) [Avatar] Offline
#2
Re: Coordinates of a live scene
[Originally posted by author]

An object's coordinates are always expressed relative to some space. The two
most common spaces are the world space, which is the same for all objects, and
the local space, which is defined by the collection of transforms "over" the
object. To do anything useful with objects you need to convert coordinates
between local and world space. For example, picking takes place in world
coordinates, but the world relative hit point on the object can be converted
into coordinates relative to the object to be more useful (e.g. which part of
the object was hit).

To do coordinate conversions (i.e. spatial transforms) you need to use the
getLocalToVworld method of the Node class. However, in order to use this
method you have to set the appropriate capability bit on the nodes involved.

Take a look at section 13.1 in the book. in particular, look at section
13.1.3 for details about using LocalToVworld. The section after it explains
the inverse (vworld to local) transform, and the section after that one
explains how to convert from one local space to another (e.g. view space to
object space).

good luck
--jon

> How do I 'extract' the coordinates of a live scene?
>
> My program works correctly - it loads in a scene. When the scene is live, I
> need access to the coordinates of the scene. How do I achieve this?
>
> Uzo