|
#1
|
|||
|
|||
smoothing a cubic bezier path
I've got an animation path that I've been having issues with. When I use a cubic bezier path, the curve will either swing too wide and leave the area I want the object to move in, or, when I add extra cp's to keep it on path, will jerk to reset it's facing rather than smoothly turn. The path is going to be way too long for just using a bezier and keeping it in the movement area.
Is there a decent way to smooth this out, or will I just have to live with the jerkiness? |
#2
|
|||
|
|||
Have you tried turning on autorotate for the animation path?
|
#3
|
|||
|
|||
Yeah, I've got autorotate on, I'll post the code as soon as I get to my computer again
|
#4
|
|||
|
|||
If you got the skills and the path is static, I'd stop right now and create the animation in 3ds Max.
I've spent way to much time tuning animation paths and they are never quite right. Controlling the node's orientation with animation paths is the hardest. You might want to control the orientation with some other method. Perhaps you could have node 'lookat' another node that moves around too?
__________________
Paul Elliott WorldViz LLC Last edited by Gladsomebeast; 04-01-2009 at 09:12 PM. |
#5
|
|||
|
|||
Here's the code.
The path is static, but I've never even looked at 3ds Max, so I wouldn't know what to do, though I might be able to pick it up with google fu. I'll give it a go, but don't know how it'll work. Code:
import viz import math import vizmat import vizinfo import vizact viz.go() #Add the street and drop it a little bit to be below the avatars feet. street = viz.add('objects/bspcity.bsp') street.translate(0,-.2,0) #Add car. car = viz.add('mini.osgx') car.setScale(.8,.8,.8) car.translate(-23,0,-8.8) path = viz.add(viz.ANIMATION_PATH) positions = [[-23,0,-8.8],[-23,0,-8],[-34,0,-8],[-34,0,0],[-43,0,0],[-43,0,8],[-43,0,17]] for x in range(0,len(positions)): cp = viz.add(viz.CONTROL_POINT) cp.setPosition(positions[x]) path.add(cp,x+1) path.constantspeed(viz.ON,1) path.loop(viz.LOOP) #computes cubic bezier path.computetangents() path.translatemode(viz.CUBIC_BEZIER) path.setAutoRotate(viz.ON) car.link(path) def onkeydown(key): if key == ' ': path.play() viz.callback(viz.KEYDOWN_EVENT,onkeydown) Last edited by just alex; 04-02-2009 at 10:44 AM. |
#6
|
|||
|
|||
Would Google Sketchup be a possible substitute for 3ds Max?
|
#7
|
|||
|
|||
Don't know if Google Sketchup will work. I'll try exporting an animation to VRML and Collada from Sketchup and testing in Vizard.
It would be nice to establish an art workflow that does not center around the expensive and complex 3ds Max.
__________________
Paul Elliott WorldViz LLC |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems with interaction of vizact.turn and animation path | Enlil | Vizard | 3 | 11-24-2008 04:23 PM |
speed on animation path | whj | Vizard | 8 | 11-17-2008 07:41 PM |
Cubic Bezier Curve | whj | Vizard | 0 | 11-10-2008 01:52 PM |
another bezier animation problem | masaki | Vizard | 1 | 01-24-2008 02:29 PM |
Smooth transition from Linear to Bezier in animation | masaki | Vizard | 2 | 01-13-2008 11:22 AM |