Skip to main content
GameDev.net gamedev.net
🔒 Locked

Matrix Water Programming

Started by SixBlades Dec 29, 2003 at 10:50 AM 3 replies 500+ views
Original Post
SixBlades
SixBlades
I was thinking about making a simple jet ski game using a matrix as water, but I don''t know how to program the matrix to look like water. Any suggestions?
Six blades are better than one.
higherspeed
higherspeed
I''m sure there are plenty of articles about producing realistic looking water. I think I''d calculate the height in two stages, one for waves and effects that would be there if the player wasn''t there and then one for waves and effects created by the player. I''d recommend that you experiment with lots of things and see what looks best, however make sure you understand what you are doing, or you''ll just get confused.
SixBlades
SixBlades
Thanks for the info, ill check it out.
Six blades are better than one.
Galapaegos
Galapaegos
SixBlades,

This is just a thought, but you could have 3d water by a 3x3 matrix that contains:

[ sin (x0) sin (x1) sin (x2) ]
[ sin (y0) sin (y1) sin (y2) ]
[ sin (z0) sin (z1) sin (z2) ]

where you have 3 direction vectors t =(x0, y0, z0), u = (x1, y1, z1), v = (x2, y2, z2). This way, a vector in the water is transformed by this "water" matrix each scene. Then each scene the t,u,v vectors would be calculated through functions of time (such as t = f(x), where x[0,1]). That should produce a waves in all directions, but if you use it you''d probably need to play around with the idea.

-brad
-brad
Mathematix
Mathematix
quote:
Original post by Galapaegos
SixBlades,

This is just a thought, but you could have 3d water by a 3x3 matrix that contains:

[ sin (x0) sin (x1) sin (x2) ]
[ sin (y0) sin (y1) sin (y2) ]
[ sin (z0) sin (z1) sin (z2) ]

where you have 3 direction vectors t =(x0, y0, z0), u = (x1, y1, z1), v = (x2, y2, z2). This way, a vector in the water is transformed by this "water" matrix each scene. Then each scene the t,u,v vectors would be calculated through functions of time (such as t = f(x), where x[0,1]). That should produce a waves in all directions, but if you use it you''d probably need to play around with the idea.

-brad

I did something like that a while back. It looked the naff side of okay.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.