Vizard 7 » Command Index » Vizard modules » viz » <viz>.mergeLinkable
7.7

<viz>.mergeLinkable

Creates a linkable object that takes the position information from one object and orientation information from another

<viz>.mergeLinkable(  
pos  
ori  
)  
pos
A linkable object that will provide the position data.
ori
A linkable object that will provide the orientation data.

Remarks

Use to combine position and orientation information from two distinct sources.

Return Value

A VizMergeLinkable object, which provides the following methods, in addition to the standard VizLinkable methods:

Method

Description

setPosLinkable(pos)

Set the linkable object that will provide position data.

getPosLinkable()

Get the linkable object that provides position data.

setOriLinkable(ori)

Set the linkable object that will provide orientation data.

getOriLinkable()

Get the linkable object that provides orientation data.

Example

#Create moving object
objMove = viz.add('marker.wrl',color=viz.RED,pos=(0,1.8,3))
objMove.add(vizact.sequence(vizact.move(0,1,0,1),vizact.move(0,-1,0,1),viz.FOREVER))

#Create spinning object
objSpin = viz.add('marker.wrl',color=viz.BLUE,pos=(0,1.8,3))
objSpin.add(vizact.spin(0,1,0,90,viz.FOREVER))

#Create an object that will move and spin
marker = viz.add('marker.wrl',color=viz.PURPLE)
linkableMoveAndSpin = viz.mergeLinkable(objMove,objSpin)
viz.link(linkableMoveAndSpin,marker).postTrans([1,0,0])

See also

<viz>.link
<viz>.grab
<viz>.blendLinkable