Hot to load an object on OpenGL? What function I should use if I use glNewList?
Posted on 2005-08-18 01:21:52 by realvampire
Depends on the object's format. I don't know if the OGL supports .X objects natively ..?
Posted on 2005-08-18 02:52:25 by ti_mo_n
Assume the file is a plain format. Only a list of float data type x,y and z value.
Posted on 2005-08-18 08:10:41 by realvampire
Then you'd have to write code to parse the file :) - I don't think there's any built-in object management code in OGL.
Posted on 2005-08-18 08:26:02 by f0dder
Or mybe yout just want to use GL_ARB_vertex_buffer_object (or ATI_vertex_array_object/ATI_map_object_buffer or GL_NV_vertex_array_range/GL_NV_vertex_array_range2) ?

BTW: that's why I prefer to stick with DX - there is no compatibility hell like this ;)
Posted on 2005-08-18 08:51:00 by ti_mo_n
TImon:
If I use that, there would be no compatibility guarantee.

I dont know how to made it but is my function is right?


CreateObjectByPolygon proc uses esi edi nmbr_obj:dword,lppoly:dword,nCount:dword
LOCAL lptess,tmp_ecx,tmp_edx:dword

cmp lppoly,0
jnz @f
ret
@@:
cmp nCount,0
jnz @f
ret
@@:
invoke gluNewTess
mov lptess,eax
invoke gluTessCallback,lptess,GLU_BEGIN,addr glBegin
invoke gluTessCallback,lptess,GLU_VERTEX,addr glVertex2f
invoke gluTessCallback,lptess,GLU_END,addr glEnd


invoke glNewList,nmbr_obj,GL_COMPILE
invoke glShadeModel,GL_SMOOTH
invoke glBegin,GL_QUAD_STRIP


mov ecx,nCount
mov esi,lppoly
xor edx,edx
@@:
mov tmp_ecx,ecx
mov tmp_edx,edx
invoke glVertex3f,,,
mov edx,tmp_edx
mov ecx,tmp_ecx
add edx,12
dec ecx
jnz @b

invoke glEnd
invoke glEndList




ret
CreateObjectByPolygon endp
Posted on 2005-08-18 10:28:31 by realvampire

Or mybe yout just want to use GL_ARB_vertex_buffer_object (or ATI_vertex_array_object/ATI_map_object_buffer or GL_NV_vertex_array_range/GL_NV_vertex_array_range2) ?

BTW: that's why I prefer to stick with DX - there is no compatibility hell like this ;)


Any .dll to load a format?
Posted on 2005-08-21 23:36:33 by realvampire
No dll I am aware of, but craploads of source out there, make your own lib - I did :)
Posted on 2005-08-22 19:46:52 by Homer