XNA C# getting 12 trangle faces of a cube , given (MIN,MAX) of BoundingBox -
is there eazy way or c# class 12 triangles of cube where, (min,max) coordinates known boundingbox cube want use primitivetype.trianglelist rendering face of cube dont know how static indices array of 12 triangles can defined , min ,max vertices of cube .
i using c# xna
thank
i figured out .... working me ..not sure if geralized way
static float , b , h ; static vector3 minv = new vector3(0f, 0f, 0f); static vector3 maxv = new vector3(a, b, h); vector3 topleftback = new vector3(minv.x, maxv.y, minv.z); vector3 toprightback = new vector3(maxv.x, maxv.y, minv.z); vector3 bottomleftback = new vector3(minv.x, minv.y, minv.z); //min vector3 bottomrightback = new vector3(maxv.x, minv.y, minv.z); vector3 topleftfront = new vector3(minv.x, maxv.y, maxv.z); vector3 toprightfront = new vector3(maxv.x, maxv.y, maxv.z); //max vector3 bottomleftfront = new vector3(minv.x, minv.y, maxv.z); vector3 bottomrightfront = new vector3(maxv.x, minv.y, maxv.z);
Comments
Post a Comment