#1
|
|||
|
|||
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) |
#2
|
|||
|
|||
Here is the file:
http://www.saliksyed.com/cathedral.WRL no textures but i *doubt* that should matter |
#3
|
|||
|
|||
So to clarify, if I zoom or tilt the camera the model translates up off the floor rather than staying on the ground!
|
#4
|
|||
|
|||
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) |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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.
|
#7
|
|||
|
|||
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.
|
#8
|
|||
|
|||
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
well thats fine since everything works. |
|
|