PDA

View Full Version : child-objects in VRML-file all have the same coordinates


Sven
06-07-2010, 09:00 AM
Hi,

I generated a simple maze using Blender, consisting of the actual maze and two additional smaller objects, which are attached to the maze's wall.
In Vizard, I can import this maze as a wrl-file without any problems, also extracting the two additional objects via getChild worked. I can manipulate the child-objects scaling, the rotation, color, all ok. However, when I query the objects' coordinates via getPosition, both the parent (maze) and the children (additional objects) have the same coordinates, namely (0,0,0). Querying the position with with ABS_GLOBAL also didn't help.

Could someone please help me out here?

Jeff
06-07-2010, 11:01 AM
Make sure you get a handle to the lowest level transform before you call getPosition with the viz.ABS_GLOBAL flag. This (http://kb.worldviz.com/articles/1157)article shows how to do this using an OSG model. The idea is the same with your VRML model, however it won't be using the GEODE naming convention.

Sven
06-08-2010, 02:21 AM
Hi,

thanks for your answer! However, I think I did the steps shown in the article (those that also should apply for wrl files), and still I only get (0,0,0) for parent and children.
Concerning getting the lowest level transform: according to the properties of the wrl file as shown in Vizard, my handle indeed aims at the lowest level featuring the gear symbol. Further down, only cube- and grid symbols are shown.

This is how I tried to do it:

track=viz.add('inftytex.wrl')
cue1=track.getChild('OB_cue_card_1_0_0')
cue2=track.getChild('OB_cue_card_2_0_0')
cuePos1=cue1.getPosition(viz.ABS_GLOBAL)

Jeff
06-08-2010, 11:51 AM
Are you saying that the purple cube object has no name associated with it?

Sven
06-09-2010, 02:07 AM
Yes, that is correct. I'll attach the complete properties window: