#Creating a mesh for a softbody
1 messages · Page 1 of 1 (latest)
@atomic sable i know your not my personal teacher but i need your help again. youre the only one theat knows the context haha. while i have made progress, i dot know whats wrong with my for loop creating the triangles. i only know that it is wrong
tris = new int[points.Length * 3];
for(int i = 0; i <points.Length-2; i++)
{
tris[i] = i;
tris[i + 1] = i + 1;
tris[i + 2] = points.Length;
}```
how does it look in wireframe? depending on the order you specify the verts it will change the "front"
i think anti clockwise is what you want
counterclockwise means the face points to me but thats not the problem i think as when looking fromthe other side in scene view it looks the same
check it in wireframe mode then to see if triangles are created or not
doesnt look like it
Well to do the triangle fan you can start with the center vert and then 2 on the edge in a counter clockwise pattern
and the triangle array should be groups of 3 vert indexes in a row
how would i do that?
well atm you increment i by 1 which is incorrect
so do i += 3
and use a new int to track the vert indexes you are using for the triangles
i don not get why it looks like this now but its an improvement i think
wdym?
If the center vert is 0 and the rest start from 1 then we want to define triangles like
0,2,1, 0,3,2, 0,4,3 ect...
Trying to point out that your logic is just wrong
ik im having to little sleep lately
Build each triangle like this
I think its counter but if im wrong you can correct it
i think i saw it in a breckeys video yesterday but it was really late wait a sec
yea its clockwise
really? open gl docs state counter clock wise is the default... https://www.khronos.org/opengl/wiki/Face_Culling
even direct x docs states counter clock wise is the typical mode
anyways its rendered from both sides right now so idk what to believe
your shader/material can change culling to be back, front or both
Anyway you should be able to make the fan correctly now and correct the direction quite easily if you desire
still dont know what you meant there