Posts

A Moving Mesh

Rajeev
A Moving Mesh
Are you looking to something, that easy to implement for your CGV project? Then you are here going to get a simple program you to can add something to it and make a good workable project. This program is called Moving Mesh. The Moving mesh is like what we use to have in DD when TV lost the signal and we get a cross horizontal moving long rectangle in different color moving fast. You can view the same in image below. Let Program the Moving Mesh First we are going to add all the Header files and global variable will be declare. #include<glut.h> #include<stdio.h> #include<math.h> #include<stdlib.h> static  GLdouble  viewer[]={0,0,5}; float dx=0.5,dy=0.5; float angle=0; To draw a mesh we are defining the mesh() function which uses the concept of looping and draw with help of vertices (primitive function). The code is given below - void mesh() { float a=0.5,b=0.5,c=1;             float  i, j;             for(i=0;i<15;i+=dx)             for(j=0;j<15;j+=dy)    …

Post a Comment