WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-06-2009, 09:53 AM
DrunkenBrit DrunkenBrit is offline
Member
 
Join Date: Dec 2008
Location: England
Posts: 25
<node3d>.getPosition() returns [0,0,0] all the time...

Hi,

I create a simple scene in 3DSM, export as either WRL or IVE format. All the scene contains is a plane, a few boxes and a sphere.

All 3 shape objects are positioned away from the origin. When i try and get access to one of the shapes:

Code:
scene = viz.add(scene.ive')
scene.disable(viz.LIGHTING,'')

sphere = scene.getChild('Sphere01')

print "sphere pos: ", sphere.getPosition(viz.ABS_GLOBAL)
I've tried printing the positions of all other objects too and also tried using viz.REL_PARENT, viz.ABS_PARENT etc which also return [0,0,0]

Any reason why this is happening please?

Thanks,
DB
Reply With Quote
  #2  
Old 02-06-2009, 11:20 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
If you right click on your scene node in the Vizard resources window and select properties, then expand the VIZARD_NODE you'll see your Sphere01 child. Expand that and you will see 'Sphere01-GEODE', which is what you want to use.
Code:
sphere = scene.getChild('Sphere01-GEODE')
print "sphere pos: ", sphere.getPosition(viz.ABS_GLOBAL)
Reply With Quote
  #3  
Old 02-09-2009, 12:53 AM
DrunkenBrit DrunkenBrit is offline
Member
 
Join Date: Dec 2008
Location: England
Posts: 25
Thanks for your reply; that worked fine! Could you explain why extra characters are added to the end of the node name? Why does it work like this to get access to a child node:

Code:
dummy = scene.getChild('dummy')
Yet to print the position i need to add on '-GEODE'?

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
timer question Elittdogg Vizard 5 10-10-2007 02:49 PM
Two animations performed by avatar at the same time michelcm3 Vizard 1 09-21-2007 09:51 AM
Printing of System Time Uttama_vizard Precision Position Tracker (PPT) 2 09-19-2007 02:38 PM
Avatar always returns in initial position pattie Vizard 2 08-31-2006 08:15 PM
Run Time Crash enkeli Vizard 4 03-08-2006 02:36 PM


All times are GMT -7. The time now is 01:19 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC