View Single Post
  #1  
Old 02-27-2014, 07:57 PM
mikeb mikeb is offline
Member
 
Join Date: Jan 2014
Posts: 2
Creating Realistic Turns in Vizard using walkTo

I'm working on a project where Vizard is being is being used to visualize various everyday walking scenarios.

A camera is linked to an avatar which is being set through these scenarios.

Initially a path was created for the avatar to follow, however the avatar and camera glitch out when turning the corner. Additionally creating a path seems to have issues with climbing non-level terrain such as slopes.

As a result <vizact>.walkTo was implemented which so far has been working perfectly for slopes. The issue with using walkTo seems to be it's difficult to simulate turns using this command.

Is there a method for creating turns using walkTo that doesn't look choppy and creates a relatively clean curve? If not is there a better way to simulate a curve in Vizard?

Currently our code looks like this for the turn
Code:
b = range(1,91,10)

print(b)
def right_turn_fcn(initX,initZ,radius):
    theta=float(0)
    for theta in ((b)):
        print theta
        Z_new=initZ+(radius*math.cos(theta/(180.0)*(3.14)))-radius

        X_new=initX+(radius*math.sin(theta/(180.0)*(3.14)))
        print(X_new,Z_new)
        avatar.addAction(vizact.walkTo([X_new,ground,Z_new],walkSpeed=speed,turnSpeed = (theta*speed/(2*radius*math.sin(theta/(2.0))))))
right_turn_fcn(-27,17.5,5)

We have tried playing with the parameter turnSpeed, but so far have not been able to achieve a smooth looking curve. Any direction would be greatly appreciated for mimicking a smooth turn.

Thanks,
Mike
Reply With Quote