WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-26-2014, 03:28 PM
Marco Marco is offline
Member
 
Join Date: Apr 2014
Posts: 5
Several quads layered one over another by draworder

Hi everyone,

seems that I can't get out of troubleshooting in my script, so I'm asking for some help.

What i'm trying to do is to play 12 videos for a test of the FOV. They should be played one after another, skipped by a keypress-action. The videos are preloaded and played like this:

# Preload all videos
PLAYLIST = ['Media/Mercury/1.avi','Media/Mercury/2.avi','Media/Mercury/3.avi']
DRAWORDER = 100
def playVideos(videos):

# Create quads
Quadleft1 = viz.addTexQuad()
Quadleft1.setScale(.4,.225)
Quadleft1.setPosition([0,0,0])
Quadleft1.drawOrder(DRAWORDER)
posleft = viz.link(viz.MainView,Quadleft1)
posleft.preTrans([-0.022,0,.1])
Quadleft1.disable(viz.RENDER_RIGHT)

Quadright1 = viz.addTexQuad()
Quadright1.setScale(.4,.225)
Quadright1.setPosition([0,0,0])
Quadright1.drawOrder(DRAWORDER)
posright = viz.link(viz.MainView,Quadright1)
posright.preTrans([0.022,0,.1])
Quadright1.disable(viz.RENDER_LEFT)

# Go through playlist
PLAYLIST = ([ viz.addVideo(filename) for filename in videos ])

# Play next video from 0
video.setTime(0)

Quadleft1.texture(video)
Quadright1.texture(video)

video.play()

# Wait for keypress # I'm trying to fade out layers step by step
yield viztask.waitKeyDown(viz.KEY_UP)

Quadleft1.alpha(Quadleft1.getAlpha() - 0.066)
Quadright1.alpha(Quadright1.getAlpha() - 0.066)

Quadleft1.drawOrder(DRAWORDER + 10)
Quadright1.drawOrder(DRAWORDER + 10)

viztask.schedule(playVideos(PLAYLIST))


I'm using the Oculus for my tests, but that shouldn't be the problem. The problem is, that I want the first video to play until KEY_UP is pressed. Then i want the first video to stop, but keep it visible with (e.g.) alpha (0.8). Following this, a second video should start and be played above the first… so the first is still visible a bit through the first. All 12 videos should be layered one over another. I think there's a more easy way to do that, but I feel like a ran into a knife!

Can anyone tell me what I'm doing wrong with the draworder (if so) or post a quick solution!

Thanks in advance
Cheers
Reply With Quote
  #2  
Old 05-27-2014, 01:36 AM
Marco Marco is offline
Member
 
Join Date: Apr 2014
Posts: 5
Sorry… of course I got a FOR statement in the code… so it looks like this:

# Preload all videos
PLAYLIST = ['Media/Mercury/1.avi','Media/Mercury/2.avi','Media/Mercury/3.avi']
DRAWORDER = 100
def playVideos(videos):

# Create quads
Quadleft1 = viz.addTexQuad()
Quadleft1.setScale(.4,.225)
Quadleft1.setPosition([0,0,0])
Quadleft1.drawOrder(DRAWORDER)
posleft = viz.link(viz.MainView,Quadleft1)
posleft.preTrans([-0.022,0,.1])
Quadleft1.disable(viz.RENDER_RIGHT)

Quadright1 = viz.addTexQuad()
Quadright1.setScale(.4,.225)
Quadright1.setPosition([0,0,0])
Quadright1.drawOrder(DRAWORDER)
posright = viz.link(viz.MainView,Quadright1)
posright.preTrans([0.022,0,.1])
Quadright1.disable(viz.RENDER_LEFT)

# Go through playlist
PLAYLIST = ([ viz.addVideo(filename) for filename in videos ])

for video in PLAYLIST:

# Play next video from 0
video.setTime(0)

Quadleft1.texture(video)
Quadright1.texture(video)

video.play()

# Wait for keypress # I'm trying to fade out layers step by step
yield viztask.waitKeyDown(viz.KEY_UP)

Quadleft1.alpha(Quadleft1.getAlpha() - 0.066)
Quadright1.alpha(Quadright1.getAlpha() - 0.066)

Quadleft1.drawOrder(DRAWORDER + 10)
Quadright1.drawOrder(DRAWORDER + 10)

viztask.schedule(playVideos(PLAYLIST))
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
addWindow DrawOrder fabioped Vizard 1 07-10-2013 09:52 AM
quads and resizing dig Vizard 4 05-01-2006 03:21 PM


All times are GMT -7. The time now is 06:34 AM.


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