WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-17-2005, 07:35 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Avatar-Format-Recommendation for Vizard

Hi,
we are just playing with Kaydara which uses the Filmbox (.fbx) format.
We can import it into 3D Studio Max and export it into a VRML-File. The Avatar moves but the shading does not seem to be right (looks kind of 2Dimensional).
What format would you recommend to import it into vizard, looking a bit more 3dimensional?

Thanks, have a great weekend,
Johannes
Reply With Quote
  #2  
Old 06-20-2005, 03:54 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Would you mind emailing me the file so that I can take a look at it?

lashkari@worldviz.com
Reply With Quote
  #3  
Old 06-30-2005, 02:17 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Hi,
Did you get the email (about a week ago)?
No problem if you do not get to it right now, just want to make sure you got it.

Right now I have the hopefully short question about vectors and translate, from time to time I get the following error using object.translate commands and vectors:


tempVector1=glider.initialVelocity*timeElapsed
print 'tempVector1',tempVector1
tempVector=vizmat.Vector(objects.get(viz.POSITION) +tempVector1)
print 'tempVector',tempVector
objects.translate(tempVector)


tempVector1 [0.000000, 0.000000, 0.895308]
tempVector [0.000000, 0.997500, 0.853729]
Traceback (most recent call last):
File "050632_GoodXX.py", line 1942, in ontimer
moveGliderEven(gliderObj)
File "050632_GoodXX.py", line 1332, in moveGliderEven
for objects in greyBallBasket:
AttributeError: Vector instance has no attribute '__float__'




Had a similar problem yesterday, but worked around it..

If I have a positionVector ballPositionVector and want to access the values (x,y,z). so I use ballPositionVector[0],ballPositionVector[1],ballPositionVector [2] and want to generate a new vector out of these I get the error below. Why that?




print self.ballPositionVector,self.ballPositionVector[0]
self.x=self.ballPositionVector[0]
print 'self.x',self.x
self.y=self.ballPositionVector[1]
self.z=self.ballPositionVector[2]
self.actualPos=viz.Vector(self.x,self.y,self.z)#ac tual Position



File "050629_GoodXXSteve.py", line 316, in initializeValues
self.actualPos=viz.Vector(self.x,self.y,self.z)#ac tual Position
File "C:\Program Files\Vizard25\vizmat.py", line 379, in __init__
elif type(x) == type([]):
AttributeError: Vector instance has no attribute '__float__'
Exception exceptions.AttributeError: "Ball instance has no attribute 'velocityXArrow'" in <bound method Ball.__del__ of <__main__.Ball instance at 0x026E48A0>> ignored
Reply With Quote
  #4  
Old 06-30-2005, 02:40 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
When you use a vector to translate an object you need to do the following:
Code:
object.translate(vector.get())
The get command will return a list of the vector values.

When creating vectors you can pass it individual values or a list or another vector:
Code:
vector = viz.Vector(0,1,2)
vector = viz.Vector([0,1,2])
vector = viz.Vector(otherVector)
Also, I never got your email.
Reply With Quote
  #5  
Old 06-30-2005, 05:25 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I looked at your model and it seems like all you need to do is enable modulation on the object:
Code:
pixie1.appearance(viz.MODULATE)
Reply With Quote
  #6  
Old 08-05-2005, 05:48 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Hi,
thank you for the answer.

1. Avatar: the line you wrote helps with the shading but the shading does not seem to be affected by the lightning of the room anymor meaning it does not matter if the avatar is below the table or on the table, the shading stays the same?! Should I rather use another format?

2. Most important problem: I'm using a modified version of the mouse-navigation from the post "Mouse problem" (steve is a research assistant here). I experience one problem when I try to rotate (with tab and mouse-button).
When I start rotating, my view jumps, which is not nice. (see attached code, import the file as a module in any existing scene).
Initialize in the scene-file with
view = viz.get(viz.MAIN_VIEWPOINT)
Navigation=SNNewBoth.SNNewBoth(view)

3. For an explanation of a vector-addition problem (physics topic: relative motion) I developed the following animation. Right now I have to start each motion seperately with a key (a, b, c). If I want them to start automatically after each other, I guess I have to do something like with

Code:
def mykeyboard(key):	
	if key == 'a':
		#arrowOrangeGlTemp.goto(0,0.5,0.2,0.05)
		#arrowOrangeGlTemp.size(
		arrowOrangeGlTemp.goto(0.3,0.5,0.2,0.1)#0.05 m per second means it takes 2 seconds
		return	
	if key == 'b':
		print 'hallo'
		arrowOrangeGlTemp.spinto(0,1,0,0,2,viz.TIME)	
		
		return	
	if key == 'c':
		arrowResultant.translate(posBlueArrow.get())
		arrowResultant.rotate(45,0,0)
		arrowResultant.scale(1,1,0.1)
		arrowResultant.visible(1)
		arrowResultant.size(1,1,1,2,viz.TIME)
ball.callback(viz.ACTION_END_EVENT,HandleStop) after each action sequence... as in one of the examples, guess there is no other way around.


4. Sometimes when I use object.alpha(0.4) I have problems with the rendering of the scene. Funny things happen e.g. the color of fieldlines is black instead of red, or transparent arrows cut wholes in the wall. Guess I will have to make some screenshots sometimes to show what I mean.


Thank you,
Johannes
Attached Files
File Type: zip snnewboth.zip (1.1 KB, 1114 views)
Reply With Quote
  #7  
Old 08-08-2005, 10:09 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

1) Vizard does not currently have shadow lighting, so the shading of objects stays the same regardless of what other objects are between it and the light source.

2) The problem is that mouse navigation is enabled on the main viewpoint. So the jumpiness is caused by the default mouse navigation fighting with your mouse navigation over control of the viewpoint.

3) You should probably use the vizact library for this. Create an action that perfroms the first two animations, and use a callback to deteremine when to perform the last part.
Code:
#Create the action once
GoAndSpin = vizact.sequence(vizact.goto(0.3,0.5,0.2,0.1),vizact.spinto(0,1,0,0,2,viz.TIME))

#Later in the code add the action to the object
arrowOrangeGlTemp.add(GoAndSpin)

#Use callback to determine when action is finished

def ActionEnd(obj,action,pool):
    if action == GoAndSpin:
        arrowResultant.translate(posBlueArrow.get())
        arrowResultant.rotate(45,0,0)
        arrowResultant.scale(1,1,0.1)
        arrowResultant.visible(1)
        arrowResultant.size(1,1,1,2,viz.TIME)

viz.callback(viz.ACTION_END_EVENT,ActionEnd)
4)I'll have to see a screenshot to understand what is going on there. But my guess is you have a problem with the draw order. Transparent objects should always be rendered after opaque objects. Also, rendering complex objects with transparency will usually create some weird artifacts also.
Reply With Quote
  #8  
Old 08-08-2005, 02:53 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
1) Thank you.

Quote:
Originally posted by farshizzo

2) The problem is that mouse navigation is enabled on the main viewpoint. So the jumpiness is caused by the default mouse navigation fighting with your mouse navigation over control of the viewpoint.
[B]Johannes wrote: Can I not transmit the viewpoint as done in, to fix it. It does not seem to work though (see also below)...
view = viz.get(viz.MAIN_VIEWPOINT)
Navigation=SNNewBoth.SNNewBoth(view)


It even happenes also, when default mouse navigation is off. It seems to be related to the y-coordinate of the view not beeing zero.

e.g. if you try to change the line in your example above from self.__view.translate(0,0,-10)
to
self.__view.translate(0,1,-10)
you will experience the jumping.


[\B]
3) Thank you, I will try that.


4) alpha: We have thrown it out, but if it happens again I will send you a Screenshot. I guess both of your guesses make sence, the complexity (I experienced it also a few months ago with field lines. )d
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 10:25 AM.


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