Requesting a different kind of rain

In my quest for better rain…

I’m wondering how hard would it be to create a 3d array.

so that from the top it looked something like this:

X X X X X
X X X X X
X X X X X
X X X X X
X X X X X

then i could take my rain falling movie clip and assign it to a point in space.

that way i was getting real 3d rain, as in real life…spatial 3d.

Also the further back the clip, the difference in alpha and scale…

so take one movie clip and resize it based on its “z” value…

and then randomize which points are selected on the ceiling of the array and let the rain fall.

any ideas? seen it done before? give me a shout?

http://proto.layer51.com/d.aspx?f=250

looks interesting, will have to test that out tonight- thank you norie-

anyone else have something?

everyone’s help is appreciated!

/bump

what if you just gave it a random x and y to end at… and then have it fall to that place… but a higher up y would mean its farther back and you can adjust the scale and alpha according to that…

let me see if i can make a quick example

here see if thats what you are lookin for… i did some commenting… hope it helps

man that was tight looking nice work-

its a start, i have this great idea tho for my site and i need to be able to have the rain in actual space, but i think it may work with what you gave; i’ll have to see…

thank you!

I don’t understand what you want exactly :slight_smile: What’s up with the 3D array and the XXXX?? :h:

The other way I can think to explain it is this:

Picture a building with fire alarm sprinklers installed on the ceiling.

You stand at the entrance to the room looking at the sprinkler heads.

They start coming on one at a time, completely at random.

The ceiling contains 20 heads in all.

Each one fires the exact same drop of water completely at random.


This is what I want.

I want to make a movieclip called “raindrop” and create a space much like the above described room. Then have my “raindrop movie clip” randomly play at each of the spots on the “ceiling” from the “sprinkler heads,” completely at random.

Now depending on how far to the front or back the “sprinkler head” was, depends on the scale of the drop or the alpha shading.

Scootman came up with the closest thing so far.

But if I could have this array, it would be awesome.

I hope that clears it up, let me know if you have any more questions.

Thank you for your attention.

-prs

I’m confused too…What scootman sent was exactly that…but without storing each rain drop in 3d space (ie.without using an array).

Why would you need to use an array???

anyway…have a look at this fla. Its not rain though, its fireworks. You can rotate the view around the ‘bursts’ by draging with the mouse. Is this what you want to do with your rain???

Oh, I see now :slight_smile:

The 3D tutorial or the perspective tutorial might help you get started. And by the way, if the position of the drops is completely random, there’s no need for that array. Just initialize the starting vertical position (y) to a constant value :slight_smile:

OK, I don’t have flash, so it might (will) be bugged, but hopefully it will give you ideas:

// global functions
speed=5;
fl=300;

// first drop
this.createEmptyMovieClip ("drop", -10);
drop.lineStyle (3, 0, 100);
drop.lineTo (.45, .15);
drop._visible = 0;

// function that creates a drop
function createDrop (x, y, z) {
depth ++;
var myDrop = drop.duplicateMovieClip ("drop"+depth, depth);
myDrop.x = x;
myDrop.y = y;
myDrop.z = z;
myDrop.scale = fl / (fl+myDrop.z);
myDrop.onEnterFrame = fall;
}
// function that makes the drop fall
function fall () {
this.y += speed;
this._x = this.x * this.scale;
this._y = this.y * this.scale;
this._alpha = 100 * this.scale;
}

// creation of the drops
setInterval (createDrop, 500, random(400), 10, random (200)+100);

No idea if this is going to work or not :stuck_out_tongue:

I was close :slight_smile:

// global variables
speed=5;
fl=300;

// first drop
this.createEmptyMovieClip ("drop", -10);
drop.lineStyle (3, 0, 100);
drop.lineTo (.45, .15);
drop._visible = 0;

// function that creates a drop
function createDrop () {
        depth ++;
        var myDrop = drop.duplicateMovieClip ("drop"+depth, depth);
        myDrop.x = random(400);
        myDrop.y = 10;
        myDrop.z = 100+random(200);
        myDrop.scale = fl / (fl+myDrop.z);
        myDrop.onEnterFrame = fall;
}
// function that makes the drop fall
function fall () {
        this.y += speed;
        this._x = this.x * this.scale;
        this._y = this.y * this.scale;
        this._alpha = 100 * this.scale;
		this._xscale = this._yscale = 100 * this.scale;
		if (this.y > 200) {
			delete this.onEnterFrame;
//			this.removeMovieClip();
		}
}

// creation of the drops
setInterval (createDrop, 50);

You’ll notice that I put a few things in the onEnterFrame that I could have put outside, but if you want to give an angle to your drops, you’ll probably have to do it like that :slight_smile:

Merci, C’est si bon!

I’m at the parent’s house for Christmas; I’ll give it a run as soon as I get back.

Thank you Thank you Thank you.

I came close the other night, but this code looks much nicer.

(my parent’s 56k aol, actually loads this forum fast…weird)