WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   moving locally (https://forum.worldviz.com/showthread.php?t=3348)

shahramy 01-16-2011 11:35 PM

moving locally
 
Hi dear all
I have some problems to move an object with 'REL_LOCAL' property.
I have linked as follows:
mylink = viz.link(viz.MainView , hand)
mylink.setDstFlag(viz.LINK_POS_RAW)
mylink.preTrans([0,-.15,0])
mylink.setMask(viz.LINK_POS)

I just need Position of 'hand' object, links to mainview position. but I want to move 'hand' object relative to its local coordination. I have (X,Y,Z) to move locally. in fact (X,Y,Z) are local coordination like (1,0,1) not global coordination.

May help me to how can I do this?

Jeff 01-18-2011 11:18 AM

The example below links the hand to a keyboard tracker and keeps it in the reference frame of the main view:
Code:

import viz
viz.go()

import vizinfo
vizinfo.add("To move the hand use 'a/d' left/right, 'w/s' forward/back, 'r/f' up/down")

import viztracker
keyTracker = viztracker.KeyboardPos()

hand = viz.addAvatar('hand.cfg')
ground = viz.addChild('tut_ground.wrl')

link = viz.link(keyTracker,hand)
link.preTrans([0.2,0,1])
link.postMultLinkable(viz.MainView)



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

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