Archived

This topic is now archived and is closed to further replies.

Scavenger

How to create random curves and apply them to a surface ?

Recommended Posts

Hi ! I have to simulate a oil slick on a water surface. But I have 2 main problems: 1. I want to create a random oil slick: To do this I have some point z (x,z) which represents the middle of the slick and n (>=3) points(x, z) which define some points laying on the border. To create a random border I want to use a curve which goes through all n points, but I can''t find anything wich explain how to do something like this. 2. I want to change the color of the water where the oil slick is from blue to black. My problem is, that the water can have any shape (simple quad, heightmap, dynamically changing waves, ..) and I don''t know which one it is.. I want to do something like this: computeWater (); // compute waves for example drawWater (); computeSlick (); // compute new position (x,z) of slick drawSlick (); Is this possible ? Is it possible to create some kind of dynamic texture and apply this one to my water surface ? If it''s not possible, how can I make it possible ? Thx. for ANY help. Andre

Share this post


Link to post
Share on other sites
This should be used for real simulations, so I can''t fake it.
The shape of the slick will change in the simulation (wind, current, ..) and I have to use it later on.

For example in the next step I have to determine if there''s oil at some position (x,z) or not and I thought the easiest way is to check which color the water surface at this position has...

I''m not sure if that''s possible with projective texturing..
furthermore the viewpoint can change at any time. How can
I compute the position/size/shape of the texture to draw ?

Andre

Share this post


Link to post
Share on other sites