Jump to content
  • Advertisement
Sign in to follow this  
bargasteh

Triangle Stripe (Texture, Normal)

This topic is 4807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I am confused over figuring out how I should assign the normals to vertices in my program (cloth). I am using triangle stripe to represent my mesh, I have a loop that draw all my stripes like this:
struct Stripes {

int number_of_nodes;
  struct Node {
     int no;
  }nodes[100];

} Tri_Stripes [50];



glBegin(GL_TRIANGLE_STRIP);
	    for(int x=1;x<=number_of_stripes;x++){
      for (int y = 0; y <= Tri_Stripes[x].number_of_nodes ; y++){
                       
vec3 no = box_array[Box_N]->particles1[Tri_Stripes[x].nodes[y].no]->velo;
glNormal3f(no.getX (),no.getY (),no.getZ ());  
        glVertex3f(box_array[Box_N]->particles1[Tri_Stripes[x].nodes[y].no]->pos.getX (),		   box_array[Box_N]->particles1[Tri_Stripes[x].nodes[y].no]->pos.getY (),	           box_array[Box_N]->particles1[Tri_Stripes[x].nodes[y].no]->pos.getZ());                               
			}//end for

    }//end for loop
glEnd();



the program draw the mesh but to calculate my normal I take each vertices's velocity (direction) and then normalise it and assign it to my glNormal3f as above. The result isnt what I want and as I can see normals are not working. Once I solve this problem I will ask my problem about textures. Thanks in advance [Edited by - bargasteh on September 14, 2005 8:49:26 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!