|
Acknowledgements For these experiments, I am indebted to Francis Gorge who created the original (and beautiful) bare bones Escher movie. He also created the excellent freeware utility 'Pageot' which I used to create the Object/Embed tag for the Quicktime movie on this page. Francis was one of the very early adopters of LiveStage, and has produced a volume of interesting experiments, demonstrations and instructional material about wired and other interesting Quicktime movies. His site QT bridge, features many of these, plus Quicktime news, much of which is in French. Even English speakers should visit his site because there is much to enjoy and inspire, plus some content is in English. |
Now, to business...
This movie demonstrates dynamic control of the ripple codec using wired actions. To download a stuffit archive containing the LiveStage 2 source project, click here. If you wish to experiment further based on the descriptions below, it's strongly recommended that you do this, open it up and inspect it. The project should open just fine with the demo version of LiveStage too.
First of all notice that the image is gently rippling. Now try clicking your mouse in the image. Notice the elliptical ripples which emanate from the cursor. Next try dragging your mouse around the movie. Notice what is happening to the play head. You will see that the more intense ripples are present towards the end of the movie. This is because a tween track has been used to change the transparency of the ripple sprite. As you drag the mouse, the play head makes it's way towards the end - the more intense ripples - and when you release the mouse, the play head makes its way back again. This gives the impression that you are 'skimming' the water with your hand.
The speed of the ripples is (according to Steve Israelson) supposed to be controlled by the opcolor of the ripple sprite (sprite 2 in this example). I haven't found this to be strictly true, but what you can do is set the draw mode of that sprite to 'blend' and then by changing the opcolor you can change the *apparent* ripple speed.
What's really happening is that you simply see less rippling when the sprite is more transparent.
Apple's (patented!) transparency technology allows you to use millions of levels of transparency involving each of the primaries, so not only can you make the ripples more or less present, you can also make them more or less red (or green, or blue, or cyan, or magenta, or whatever).
Colorised ripples can be used to 'match' your content so it is not so high contrast. Of course 'real' ripples tend to reflect the brightest light source, so you should match your brightest light source - in general go for a pale blue for outdoors, a pale yellow (red+green) for indoors, but you can also go for more spielbergian effects. In the example above, my tween goes from Dark Blue to Sky Blue, which makes for a more subtle effect.
Best of all, you can make the ripple transparency dynamic without any scripting at all. Just create a graphics mode tween and use the default values with 'Blend' as the draw mode. (Completely black to completely white). Give the tween a useful name, then go back to your Ripple sprite and assign this tween to its graphics mode from the source popup. Just play with the playback head to see the effect.
If you can get on with just a little scripting, you can manipulate the movietime, for example on 'mouseMoved', so that more agitated movements you make, the more intense the ripples become.
| If you don't have LiveStage Pro 3 or later you can simulate 'mouseMoved' by caching the mouse coordinates on idle, and sending a custom 'mouseMoved' event only if the coordinates have changed since the last time you checked. If you also check whether the mouse button is down, you have 'mouseDrag' (which isn't yet a standard mouse event in Quicktime). The project file for this movie is for LiveStage Pro 2, so you will be able to see this technique in action there. |
The elliptical ripples are caused by passing your mouse click to the ripple codec with the 'passMouseToCodec' command. Other interesting effects can be achieved by getting the ripple sprite to send a 'mouseDown' event to itself. This will make more ripples emanating from the mouse cursor, even if you aren't clicking the mouse button.
To send a mouseevent, use the standard command 'executeEvent', and use one of the Quicktime mouse event ID constants (Qscript palette->Other). For example, the following line of code will send a 'mouseDown' event to the current sprite.
ExecuteEvent(kQTEventMouseClick)
Alternatively, if you want to have elliptical ripples appearing independent of the mouse, use the 'clickOnCodec' command, and pass whatever x and y values you like, but creating a satisfying effect can take a lot of work because this action only takes constant values. :-(