Question

I'm not completely solid on how triangle strips work with normals. I want to make a flat shaded cube so I wrote vertices for a triangle strip that make a cube. That works. I made a cube using a triangle strip. The thing is that I set the normals of each vertex as the opposite direction of the center of the cube. So the shading is all weird. I want each side to be a flat color. Any idea how I can set the normals to achieve this?

Was it helpful?

Solution

So, you have normals pointing out from the center of the cube, in a circular fashion?

 \_/
-|_|-
 / \

Is this how it looks?

Is the goal something like this?

  L
-| |-
  T

If that is the case, you could just check which normals your normals are closes too, then change them into the closest normal.

distance = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z2)^2)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top