WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Left Hand (https://forum.worldviz.com/showthread.php?t=1326)

rubberpimple 02-01-2008 09:32 AM

Left Hand
 
I need to animate a LEFT hand in Vizard...is there some easy way to mirror the stock hand.cfg??

farshizzo 02-01-2008 10:05 AM

If you are using the hand module, then you can use the following code:
Code:

import hand
h = hand.add(sensor)

#Display as left hand
h.leftHand()

If you are manually loading the hand.cfg file, then you can us the following code:
Code:

hand = viz.add('hand.cfg')
hand.scale(-1,1,1)
hand.enable(viz.FLIP_POLYGON_ORDER)


rubberpimple 02-05-2008 02:00 PM

Using the second option gives me a darkly-shaded, flipped-over (palm facing up) hand. Is there a better way?

farshizzo 02-05-2008 02:07 PM

If you run the following script does the shading on the left hand look darker than the right hand?
Code:

import viz
viz.go()

rhand = viz.add('hand.cfg',pos=(0.1,1.8,0.5),euler=(0,-90,0))

lhand = viz.add('hand.cfg',pos=(-0.1,1.8,0.5),euler=(0,-90,0))
lhand.scale(-1,1,1)
lhand.enable(viz.FLIP_POLYGON_ORDER)

rhand.add(vizact.spin(0,0,1,45))
lhand.add(vizact.spin(0,0,-1,45))


rubberpimple 02-05-2008 03:03 PM

Wow...those look perfect. I think there is something else in my code that is mucking things up. I'll investigate...

rubberpimple 02-05-2008 03:05 PM

Does messing with window POV commands have this effect?

farshizzo 02-05-2008 03:07 PM

Can you just post a sample script of yours that makes the left hand darker?

rubberpimple 02-05-2008 03:16 PM

Here it is:

myHand = viz.add('hand.cfg',pos=(0.1,1.8,0.5),euler=(0,-90,0))
myHand.scale(-1,1,1)
myHand.enable(viz.FLIP_POLYGON_ORDER)
myHand.setScale(20,20,20)

It's the setScale command. Not sure why, but the hand becomes right handed and appears darker.

farshizzo 02-05-2008 03:17 PM

Your sample code is undoing the negative x scale, which is required for inverting the hand and making it look left handed. Use the following code instead:
Code:

myHand = viz.add('hand.cfg',pos=(0.1,1.8,0.5),euler=(0,-90,0))
myHand.enable(viz.FLIP_POLYGON_ORDER)
myHand.setScale(-20,20,20)


rubberpimple 02-05-2008 03:20 PM

Nice! Many thanks...


All times are GMT -7. The time now is 07:24 AM.

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