![]() |
|
|
|
#1
|
|||
|
|||
|
The following code adds texture quads to each window and textures them. Is this what you are looking for?
Code:
import viz
import vizact
viz.go()
texture = viz.addTexture('ball.jpg')
road = viz.addTexQuad()
road.texture(texture)
road.visible(0)
for i in range(1,100):
road.clone(pos=[0,0,i],euler=[0,90,0])
road.clone(pos=[0,0,i],euler=[0,90,0],scene=2)
leftWindow = viz.MainWindow
leftWindow.setSize([0.5,1])
rightWindow = viz.addWindow(pos=[0.5,1],size=[0.5,1])
rightView = viz.addView(scene=2)
rightWindow.setView(rightView)
leftView = viz.MainView
def moveViews():
leftView.move([0,0,.03])
rightView.move([0,0,.1])
vizact.ontimer(0,moveViews)
|
|
#2
|
|||
|
|||
|
Hi Jeff,
thanks for that; yes, that's the idea but it's a follow on from another experiment so it has to have an identical set up as before, ie the surface and position of the road, the temporal frequency of the lines, plus the road needs to continue indefinitely to the end of the experiment. All the other parts are already coded (although I may need to call upon your expertise for additional parts of the experiment - sorry!) so it's just really a case of assigning a left quad to the left window and right quad to the right window using the code that I already have. Is this possible or do I need to change the code so that it is similar to what you have written? Thanks |
|
#3
|
|||
|
|||
|
Hi Jeff,
Further to my last post I've done a bit of experimenting with the code and the problem appears with this part of the coding that makes the road infinite Code:
def addRoadr(): global roadr_position, roadl_position viewpointr_pos = viz.MainView.getPosition() rightView.setPosition(viewpointr_pos) #check to see how close the viewpoint is to the end of the road if roadr_position - viewpointr_pos[2] < 50: #add 50 meters of road for i in range(1,50): #quadrcopy = quadr.copy(scene=2)#makes left hand quad appear in both windows quadrcopy = quadr.copy()#makes the 2 quads appear in each window quadrcopy.setPosition([0.75,0,roadr_position]) quadrcopy.setEuler(0,90,0) roadr_position +=1 viz.MainView.move(0,0,MOVE_SPEEDr,viz.HEAD_ORI) addRoadr() #call a timer every frame to check if road needs to be added vizact.ontimer(0, addRoadr) Thanks |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rotate around moving axis | moneim230 | Vizard | 1 | 07-14-2010 09:04 AM |
| Stop moving after few seconds?? | Chrissy2009 | Vizard | 8 | 05-10-2009 02:47 PM |
| Moving avatars lips with sound | dan12345 | Vizard | 5 | 01-29-2008 07:32 PM |
| Moving view with object | Xliben | Vizard | 2 | 07-25-2005 05:36 PM |
| moving viewpoint vs. translating Head_pos | bailenson | Vizard | 5 | 02-01-2005 01:51 PM |