WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-06-2016, 07:59 AM
chris2307 chris2307 is offline
Member
 
Join Date: Nov 2013
Posts: 36
Getting an object location

I'm feeling a little frustrated right now. I am trying to get the 3D position of an object within an exported OSGB scene. I know the name of my object; I've called it target. I can even find this object using the following snippet of code:

Code:
for nodeName in WholeEnviroment.getNodeNames():
	if(nodeName == 'Target'):
		node = WholeEnviroment.getChild(nodeName)
		print node
However, when I attempt to extract the 3D information for this, I get either the following two results:

Code:
print node.getPosition()
Return value: [0, 0, -0]

Code:
print node.getPosition(viz.ABS_GLOBAL)
Return value: [0.0, 2.7850825786590576, -8.960569381713867]


Neither are correct. The correct position of this object is [-11.54891, 2.32127, -16.42012].

I am able to use viz.pick to select the object and I get the correct position which is great. However, viz.pick() seems to return the lowest level of an object (the material name in this instance).

Why am I unable to get a sensible value from simply specifying the node name? I'm either missing something very obvious or it's just another annoying quirk of Vizard.

This is how the structure of this node looks like in Vizard inspector: http://prntscr.com/dg30pa

Last edited by chris2307; 12-06-2016 at 08:03 AM.
Reply With Quote
 

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
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
checking object location in an inclosed area of the world Chapre Vizard 2 10-08-2010 12:57 AM
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
Gps input for viewpoint location? realvision Vizard 3 03-19-2008 12:37 PM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM


All times are GMT -7. The time now is 02:48 PM.


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