WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   cinematic fade to black? (https://forum.worldviz.com/showthread.php?t=2442)

billjarrold 12-16-2009 01:49 PM

cinematic fade to black?
 
Hi,

Can anyone point me to the best way to achieve a cinematic fade to black? (Well, what they really want to do is fade to blue).

After our experiment finishes we want it to gradually fade to black rather than abruptly end.

I could use fog but I am not getting good results with gradual onset of fog. I could probably code that better. However, I think there is an easier way, simple elegant way to do this.

Weeks ago I stumbled across something in the manual that seemed to be devoted just to fade to black or really fade to any color, however I did not know I needed it for our experiment then. Now, when I need it, I can't find it in the manual nor the forum having searched on "fade", "black", etc.

(An alternate method might be to change the color of every object. But again this seems inelegant).

Thanks,

Bill

IGoudt 12-17-2009 04:41 AM

.fadeTo() might do want you want.

fadeAction = vizact.fadeTo(viz.BLACK,time=2)
object.addAction(fadeAction)

billjarrold 12-18-2009 11:10 AM

Thanks for the reply....right, so the question with a solution like the one you suggested is what to bind object to? I suppose I could map through every single object in the scene. But as I said in my original post, this seems inelegant (and not the kind of solution I remember thinking I glanced at several weeks/months ago).

Further, even if I do map through all objects and apply the fade to black action, then how do I make the rest of the world fade to black.

To make this concrete, see the code below which applies the solution you suggested. You'll see the dude fades to black but the world/room (aka "lab") does not. If someone can tell me how there's an easy way to make the rest of the word/room fade to black then perhaps I am done (I will next have to map through every object (node?) but I think I have some ideas on how to do that)..

Okay, here's the code.....

viz.go()

dude = viz.addAvatar('vcc_male.cfg')

lab = viz.add('lab.ive')

fadeAction = vizact.fadeTo(viz.BLACK,time=10)

dude.addAction(fadeAction)
lab.addAction(fadeAction)

....when you'll run it you'll see the dude fade to black but the room not.

(Tangential question: why does dude go from a state where's he's frozen in a kind of "scarecrow" posture to the "idle" posture (i.e. where he's standing relatively still but like a normal person, shifting he weight a little, looking around etc...state = 1 or somesuch??)...I never told vizard to make him change his state. Why does it do this?)

farshizzo 12-18-2009 11:19 AM

I've implemented a similar effect in the past by creating a fullscreen black quad and fading the alpha from 0 to 1. Here is a simple example:
Code:

import viz
viz.go()

viz.add('gallery.ive')

blackScreen = viz.addTexQuad(parent=viz.SCREEN,scale=[100.0]*3,color=viz.BLACK)
blackScreen.alpha(0.0)

vizact.onkeydown(' ',blackScreen.runAction,vizact.fadeTo(1.0,time=2.0))


billjarrold 12-23-2009 11:09 AM

thanks - problem solved
 
thanks! i tested it inside my program and it works great. just the kind of simple solution i was looking for. (and also different than the aforementioned 'fade to black' i thought i saw in the manual several weeks/months back....probably what i thought i saw is in reality mirage, i.e. not really an implementation of fade to black).


All times are GMT -7. The time now is 07:27 AM.

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