WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-12-2007, 02:19 PM
v-Salik v-Salik is offline
Member
 
Join Date: Sep 2007
Posts: 20
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)
Reply With Quote
  #2  
Old 09-12-2007, 02:32 PM
v-Salik v-Salik is offline
Member
 
Join Date: Sep 2007
Posts: 20
Here is the file:
http://www.saliksyed.com/cathedral.WRL

no textures but i *doubt* that should matter
Reply With Quote
  #3  
Old 09-12-2007, 02:41 PM
v-Salik v-Salik is offline
Member
 
Join Date: Sep 2007
Posts: 20
So to clarify, if I zoom or tilt the camera the model translates up off the floor rather than staying on the ground!
Reply With Quote
  #4  
Old 09-12-2007, 03:07 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
  #5  
Old 09-12-2007, 04:56 PM
v-Salik v-Salik is offline
Member
 
Join Date: Sep 2007
Posts: 20
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.
Reply With Quote
  #6  
Old 09-12-2007, 05:08 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #7  
Old 09-13-2007, 01:54 PM
v-Salik v-Salik is offline
Member
 
Join Date: Sep 2007
Posts: 20
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.
Reply With Quote
  #8  
Old 09-13-2007, 02:06 PM
v-Salik v-Salik is offline
Member
 
Join Date: Sep 2007
Posts: 20
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.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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