• Create Account

Banner advertising on our site currently available from just \$5!

### #ActualZiath

Posted 02 June 2013 - 08:43 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


### #1Ziath

Posted 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.

                                                       // 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