WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Getting Position (https://forum.worldviz.com/showthread.php?t=4209)

Lynnifer 04-18-2012 11:34 AM

Getting Position
 
How can I find the absolute position in space of a 3d text object. I am using a 3d text "+" sign as a pointer in my program. It is attached to a parent node (handNode) which moves based on a motion tracker.

handNode = viz.add(viz.TEXT3D,'.')
#handNode.visible ( viz.ON )
handNode.color(1,0,0) # red
handNode.scale(.005, .005, .005)
pointer = handNode.add( viz.TEXT3D,'+')
#pointer.visible ( viz.ON )
pointer.translate(0, 0, 12)
pointer.color(1,0,0) # Red
pointer.scale(18, 18, 18)

Right now, I am using " pointer.get(viz.POSITION) " to get its position in 3d space. It can be seen in this statement of the program:

DaAngleBearing = self.findBearing( viz.get(viz.HEAD_POS), pointer.get(viz.POSITION) )
DaAnglePitch = self.findPitch(viz.get(viz.HEAD_POS), pointer.get(viz.POSITION) )


Right now, when I use print outputs to find what the program is doing, it looks like it's giving me the pointers position relative to another object, and that relative position is going into the statement above and being used to calculate the angle and pitch between head and pointer. I need to use the absolute position of the pointer. Any suggestions are appreciated.

DillonB 07-16-2012 09:49 AM

pointer.getPosition(viz.ABS_GLOBAL) should give you the absolute position. Check out this tutorial: http://docs.worldviz.com/vizard/inde...orial_list.htm


All times are GMT -7. The time now is 09:07 AM.

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