Vizard 8 » Command Index » Vizard modules » viz » <viz>.addControlPoint
8.0

<viz>.addControlPoint

Adds a control point.

<viz>.addControlPoint(  
pos = None  
quat = None  
euler = None  
axisAngle = None  
scale = None  
)  
pos = None
Optional position of control point
quat = None
Optional quaternion rotation of control point
euler = None
Optional euler rotation of control point
axisAngle = None
Optional axis-angle rotation of control point
scale = None
Optional scale of control point

Remarks

A control point is used in conjunction with AnimationPath. The object created here is a point along the animation path.

Return Value

<controlpoint> object

Example

ball = viz.addChild('beachball.osgb')
viz.MainView.setPosition([0,2,-8])

path = viz.addAnimationPath()

path.play()
path.setLoopMode(viz.CIRCULAR)
path.setAutoRotate(viz.ON)

positions = [ [0,0,2], [2,0,0], [0,0,-2], [-2,0,0] ]

for t,pos in enumerate(positions):
    b = viz.addChild('beachball.osgb')
    b.setPosition(pos)
    b.alpha(0.2)
    cp = viz.addControlPoint(pos=positions[t])
    path.addControlPoint(t+1,cp)

viz.link(path,ball)