WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-05-2011, 04:58 AM
Saz Saz is offline
Member
 
Join Date: Nov 2008
Posts: 36
Hi Jeff,
thanks for that, I've decided to use to quads and apply the textures to them instead. I'm trying to code for the textures in these two quads to both move at independent speeds in a downward motion (like lines moving down a page). In the past I've used the viz.MainView.move command but obviously that moves the whole viewpoint and so the whole quad moves (and then disappears) rather than the textures inside them.

Here is the code written so far:
Code:
import viz
#Import vizjoy module
import vizjoy  
import time
import math
import vizact
import vizinfo
import vizshape

viz.displaymode(1024, 512)
viz.go(viz.FULLSCREEN)
viz.mouse(viz.OFF)
vizact.ontimer(32,viz.quit) #runs file for 32 secs


subject = viz.input('What is the participant number?')

#define speed
MOVE_SPEED = 0.1041 #scalar constant for speed gain

viz.clearcolor(0.5,0.5,0.5)
viz.MainView.setPosition(0,.5,0)



#add the road texture
road = viz.add('roadld3.png')

#create a texture quad1 to add the road texture to
#and place it over ground
quad1 = viz.addTexQuad()
quad1.setScale(0.25,0.5,0.25)
quad1.setPosition(0.75,0.5,3)
quad1.setEuler(0,0,0)
quad1.texture(road)

#create a texture quad2 to add the road texture to
#and place it over ground
quad2 = viz.addTexQuad()
quad2.setScale(0.25,0.5,0.25)
quad2.setPosition(-0.75,0.5,3)
quad2.setEuler(0,0,0)
quad2.texture(road)


#move quad 1
def moveQuad1():
	
	viz.MainView.move(0,0,MOVE_SPEED,viz.BODY_ORI)

moveQuad1()
#call a timer every frame to check if road needs to be added
vizact.ontimer(0, moveQuad1)
Is there tutorial that explains how to assign different speeds (or speeds at all) to the textures inside quads? Any help is much appreciated
Thanks
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Draw line with a triangle at the end Chrissy2009 Vizard 9 08-24-2009 11:12 AM
Draw a triangle instead of a point Chrissy2009 Vizard 1 07-21-2009 09:46 AM
Draw Vector in viewpoint lookat direction Chrissy2009 Vizard 2 05-30-2009 12:50 AM
Draw Line between Points Chrissy2009 Vizard 2 05-13-2009 04:42 AM
Draw Line between Points selected by mouse Johannes Vizard 7 01-07-2005 02:50 PM


All times are GMT -7. The time now is 07:40 PM.


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