PDA

View Full Version : manually attaching opjects to tracked locations


mspusch
04-13-2005, 09:24 PM
Interesting question from Worldviz Support Forum at
http://worldviz.us/tt/index.php:

I would like to spawn objects at the locations of the motion tracking pointers. I can easily import objects and link them to the tracker points, but I don't want the object following the pointer once they are created. What would be the best way to import a current tracking point and assign the location to an object's position that will not change?
how would I attach an object to that location in time without using the Link command? Can I use the 'get' function of the vizppt.dls sensor plugin?

mspusch
04-13-2005, 09:25 PM
You can easily do the following in a timer or keyboard event:


# Initialization
obj = viz.add('myobject.wrl')
ppt = viz.add('vizppt.dls')

# In the event
data = ppt.get()
newObj = obj.copy()
newObj.translate(data[0], data[1], data[2])


The event code spawns a new object (without accessing the disk) and then uses the current PPT location assign it's location.


Hope this helps,
WorldViz Team