WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Bug... when I translate the view using mouse (https://forum.worldviz.com/showthread.php?t=1210)

v-Salik 09-12-2007 02:19 PM

Bug... when I translate the view using mouse
 
Pretty simple setup. I have a room with a human being and a room. When I click the bottom of the screen it seems like the avatar model translates at a rate much faster than the regular room. This doesn't really make any sense because it's all very simple code.
Code:


import viz
viz.go()
room = viz.add('cathedral.WRL')
room.setPosition(100,240,1600)
room.rotate(180,0,0)
room.appearance(viz.MODULATE)


def initLights():
        #Add a light to the empty node
        mylight = viz.add(viz.LIGHT)

        #Set the light parameters
        mylight.position(0,0,0)
        mylight.direction(0,0,90)
        mylight.spread(90)
        mylight.intensity(2)
        mylight.spotexponent(2)
        mylight.ambient([.8,.4,.1])

initLights()

#Disable the headlight on the room
male = viz.add('male.cfg')
male.state(1)
male.loitering=False
male.walking=False
room.disable(viz.LIGHT0)
male.setPosition(0,0,6)


v-Salik 09-12-2007 02:32 PM

Here is the file:
http://www.saliksyed.com/cathedral.WRL

no textures but i *doubt* that should matter

v-Salik 09-12-2007 02:41 PM

So to clarify, if I zoom or tilt the camera the model translates up off the floor rather than staying on the ground!

farshizzo 09-12-2007 03:07 PM

This is an illusion due to the fact that your cathedral model is very big and placed far away from the viewpoint. You need to scale down your cathedral model and center it around the avatar. For example, try initializing the cathedral with the following values:
Code:

room = viz.add('cathedral.WRL')
room.scale([0.01]*3)
room.rotate(180,0,0)
room.appearance(viz.MODULATE)


v-Salik 09-12-2007 04:56 PM

Hmmm....
I'm pretty certain it is not an illusion (that was my first guess), try tilting the view up or down, the model clearly lifts off the floor. The model scales at a rate much faster than the room scales (not proportionate to their size differences).


Scaling the room doesn't solve the problem since I *want* a very large room. Do I need to scale everything else down in comparison? I don't see why view transformations would depend on size at all anyways.

farshizzo 09-12-2007 05:08 PM

The dimensions of your cathedral model are 1153x1000x2148 meters, which means it is over 1 mile long. Imagine having a small object 1 meter in front of you and a large mountain in the background 2 miles away. When you tilt your head up and down, the object in front of you *appears* to move more than the mountain does. You need to scale down your cathedral model to some reasonable size and place the avatar inside it.

v-Salik 09-13-2007 01:54 PM

Okay I see, so why is the avatar still so big? I mean the cathedral doesn't seem a mile long relative to my avatar model.

v-Salik 09-13-2007 02:06 PM

Oh never mind, you're right it does work.... I guess something weird was happening because before my avatar was very big even though I didn't apply any scaling transforms to it. Now when I applied a scale to the cathedral the male also got very small! so I scaled down the cathedral further and then everything was fine:confused:

well thats fine since everything works.


All times are GMT -7. The time now is 02:41 AM.

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