Jump to content

  • Log In with Google      Sign In   
  • Create Account

Ziath

Member Since 01 Jun 2013
Offline Last Active Jun 02 2013 12:45 PM

Posts I've Made

In Topic: Weird tiled effect with calculating Normals, TRIANGLE_STRIPS

02 June 2013 - 08:25 AM

Shouldn't it be vBuffer.get(3*n+0), and so on?

 

I don't think so, each point needs to calculate its near points: p3-p1 p2-p1, right? so each time it runs, the normal calculation shifts up by one point.

 

Never mind. I need my coffee. haha. but why is it that it needs to be multiplied by 3?

 

                                                       // first set // second // third.. and so on
                        float x1 = vBuffer.get(n + 0); // 0 // 1 // 2
			float y1 = vBuffer.get(n + 1); // 1 // 2 // 3
			float z1 = vBuffer.get(n + 2); // 2 // 3 // 4
				
			float x2 = vBuffer.get(n + 3); // 3 // 4 // 5
			float y2 = vBuffer.get(n + 4); // 4 // 5 // 6
			float z2 = vBuffer.get(n + 5); // 5 // 6 // 7
	
			float x3 = vBuffer.get(n + 6); // 6 // 7 // 8
			float y3 = vBuffer.get(n + 7); // 7 // 8 // 9
			float z3 = vBuffer.get(n + 8); // 8 // 9 // 10

PARTNERS