| |
|
|
||||
![]() |
||||||
| |
|
|||||
|
First Simulation Using Sphere Mapping
If sphere mapping is applied to a perturbed polygonal mesh, a very interesting effect can be achieved (Figures 7 and 8 show the results, Figure 9 shows the textures used). The implementation is a combination of the two techniques explained before, plus the vertex normal calculations, because the mesh deforms each frame. Finally, when the perturbation values are tuned (amplitude, frequency, velocity, and so on), it's important to use small amplitudes for the waves. In tall waves the textures stretch too much, creating undesirable effects. The code for the render function is shown in Listing 3. Listing 3. Render function using sphere mapping result
water_render (WATER *water) resulterror_code; }
Next time, in part two of this article, I will dive into refractive texture mapping for simulating water refraction. I'll also provide a second simulation as well as some optimizations and the sample application.
Direct X 7 SDK Help (Microsoft Corp.) Serway, R. Physics for Scientists and Engineers with Modern Phyisics, 4th ed. HBJ, 1996. pp. 1023-1036. Ts'o, Pauline, and Brian Barsky. "Modeling and Rendering Waves: Wave-Tracing Using Beta-Splines and Reflective and Refractive Texture Mapping." SIGGRAPH 1987. pp. 191-214. Watt, Alan, and Fabio Policarpo. The Computer Image. Addison-Wesley, 1997. pp. 447-448. Watt, Alan, and Mark Watt. Advanced Animation and Rendering Techniques: Theory and Practice. Addison-Wesley, 1992. pp. 189-190 Harris, John W., and Horst Stocker. Handbook of Mathematics and Computational Science. Springer Verlag, 1998. PlayStation Technical Reference Release 2.2, August 1998 (Sony Computer Entertainment) Elias, Hugo. http://freespace.virgin.net/hugo.elias/graphics/x_water.htm Lander, Jeff. "A Clean Start: Washing Away the New Millennium." Game Developer (December 1999) pp. 23-28. Haberman, Richard. Elementary Applied Partial Differential Equations, 3rd ed. Prentice Hall, 1997. pp. 130-150. Graff, Karl F. Wave Motion In Elastic Solids. Dover Publications, 1991. pp. 213-272. Discuss this article in Gamasutra's discussion forums ________________________________________________________
|
|
|