WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Body linking (https://forum.worldviz.com/showthread.php?t=1376)

nige777 03-05-2008 04:04 PM

Body linking
 
Hi,
I'm developing a training environment where the user must operate a fork lift truck and be able to get on and off. I have set up the fork lift using physics joints and motors so that it "behaves" correctly, which it does-to a certain, pretty much.
Firstly when I pick up the objects with the forks that need loading and stacking (cages made with collideBox's top and bottom) there is a noticeable 'wobble', to the point when it looks unrealistic. Is this a trade off of using a bunch of dynamic physics shapes held together with physics joints?
Secondly when linking the viewpoint to the fork lift I loose control of the head, I presume it is the head_ori that is linked is it? I have tried using setMask but to no avail:(.I have tried using this:
Code:

#TIMER
def onTimer(num):
#    #The timer with the id 'num' has expired
    if num == 0:
        #Link matrix of runners to forks(turning)
        turn = run.getMatrix()
        turn.preTrans(0,1.6,0)
        view.setMatrix(turn,viz.BODY_ORI)
       
viz.callback(viz.TIMER_EVENT,onTimer)
viz.starttimer(0,viz.FASTEST_EXPIRATION,viz.FOREVER)

which does what I want but produces REALLY bad juddering when the truck is moving.

Am I missing something really simple here?

Regards

Nige

nige777 03-06-2008 09:05 AM

Update
 
Hi all wizards,

Juddering experienced whilst moving has been improved by tweaking setStepSize and setAccuracy, although it is not perfect (yet), and the cages still cause the forks to wobble, I am more confident that I can achieve acceptable results.

Take it easy

farshizzo 03-06-2008 09:27 AM

The following code should link to rotation of the fork lift to the view body:
Code:

bodyLink = viz.link(forkLift,viz.MainView,mask=viz.LINK_ORI,dstFlag=viz.LINK_BODY)

nige777 03-06-2008 02:17 PM

Nice 1
 
Cheers man,

ended up using
Code:

bodyLink = viz.link(body,view,dstFlag=viz.LINK_BODY)
as the exact line of code you gave me only linked the orientation of the body(or head?) i think as the view didn't move with the truck, but hey, thanks again for your help.

Regards,
Nige


All times are GMT -7. The time now is 10:50 PM.

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