Download.it search icon
Advertisement

OpenGL demo simulating ocean waves with sine-based dual-surface animation and moon reflection, source code included

OpenGL demo simulating ocean waves with sine-based dual-surface animation and moon reflection, source code included

Vote: (8 votes)

Developer: MASMO

Created: 2003-05-20

MD5: 93521c9bdda13feb2c685bac1554bebf

Size: 635.6 KB

Vote

(8 votes)

Developer

MASMO

Created

2003-05-20

MD5

93521c9bdda13feb2c685bac1554bebf

Size

635.6 KB

'Waves' is the effect of the sea that has been realized with the use of the function Sin().

'Waves' is the effect of the sea that I have realized with the use of the function Sin(). To recreate the effect of the movement, I have inserted two surfaces with movement moved of some degree. The reflex of the moon is only a texture. The demo occupies 635Kbytes.

Routine Description

AUX_RGBImageRec *LoadBMP(char *Filename) Loads a bitmap image (called by LoadGLTextures)

int LoadGLTextures() Load Bitmaps And Convert To Textures

void VectorNormalize() ..... Vector Functions (used by Luce)

void glPrint(char *ll,float x,float y,float z,float dim,float dir,float r,float g,float b) My routine for print with opengl :

Char *ll => the line

x,y,z => the coordinates

dim => the font dimension

dir => not used for now

r,g,b => the color

void CreaGrid(void) Creates the grid for the water

void ScrollQuad(void) Scroll the grid in Z direction.The scroll creates the effect of the wave movement.

void ViewFondo() Draws the ground. Not Used

void ViewQuad_line(void) Draws the Water using the LINES

void ViewQuad_texture(void) Draw the water using QUADS and Texture

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)

int InitGL(GLvoid)

int DrawGLScene(GLvoid)

GLvoid KillGLWindow(GLvoid)

BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)

LRESULT CALLBACK WndProc(..)

int WINAPI WinMain(..)

The Asteroid is an Milkshape Object (see Nehe Web Pages)

These routines have been taken by the examples of NeHe