bobert

03-01-2002, 02:18 PM

I have a great AABB system up and and working in my opengl engine. Im loading animated milkshape s as both levels and characters. (sweeeeeeet....)

However, when i go to scan the vertices (400 or so) for the max's and min's i get

max: 6, 7, 25

min:-6,-11,-6

(rounded up)

when milshape tells me:

max: 15, 35, 13

min:-15,-40, -9

gah!!?? why??

this is my code:

Max[0] = Max[1] = Max[2] = 0.0f;

Min[0] = Min[1] = Min[2] = 0.0f;

for (int pnt = 0; pnt < Mod->m_numVertices; pnt++)

{

if (Mod->m_pVertices[pnt].m_location[0] > Max[0])

{Max[0] = Mod->m_pVertices[pnt].m_location[0]; }

if (Mod->m_pVertices[pnt].m_location[0] < Min[0])

{Min[0] = Mod->m_pVertices[pnt].m_location[0]; }

if (Mod->m_pVertices[pnt].m_location[1] > Max[1])

{Max[1] = Mod->m_pVertices[pnt].m_location[1]; }

if (Mod->m_pVertices[pnt].m_location[1] < Min[1])

{Min[1] = Mod->m_pVertices[pnt].m_location[1]; }

if (Mod->m_pVertices[pnt].m_location[2] > Max[2])

{Max[2] = Mod->m_pVertices[pnt].m_location[2]; }

if (Mod->m_pVertices[pnt].m_location[2] < Min[2])

{Min[2] = Mod->m_pVertices[pnt].m_location[2]; }

}

any ideas?

-bobert

However, when i go to scan the vertices (400 or so) for the max's and min's i get

max: 6, 7, 25

min:-6,-11,-6

(rounded up)

when milshape tells me:

max: 15, 35, 13

min:-15,-40, -9

gah!!?? why??

this is my code:

Max[0] = Max[1] = Max[2] = 0.0f;

Min[0] = Min[1] = Min[2] = 0.0f;

for (int pnt = 0; pnt < Mod->m_numVertices; pnt++)

{

if (Mod->m_pVertices[pnt].m_location[0] > Max[0])

{Max[0] = Mod->m_pVertices[pnt].m_location[0]; }

if (Mod->m_pVertices[pnt].m_location[0] < Min[0])

{Min[0] = Mod->m_pVertices[pnt].m_location[0]; }

if (Mod->m_pVertices[pnt].m_location[1] > Max[1])

{Max[1] = Mod->m_pVertices[pnt].m_location[1]; }

if (Mod->m_pVertices[pnt].m_location[1] < Min[1])

{Min[1] = Mod->m_pVertices[pnt].m_location[1]; }

if (Mod->m_pVertices[pnt].m_location[2] > Max[2])

{Max[2] = Mod->m_pVertices[pnt].m_location[2]; }

if (Mod->m_pVertices[pnt].m_location[2] < Min[2])

{Min[2] = Mod->m_pVertices[pnt].m_location[2]; }

}

any ideas?

-bobert