I dont know is it work or not since now Im not at home but at another city.
CreateObjectByPolygon proc uses esi edi lppoly:dword,nCount:dword
LOCAL lptess,tmp_ecx,tmp_edx,rv:dword
cmp lppoly,0
jnz @f
ret
@@:
cmp nCount,0
jnz @f
ret
@@:
invoke glGenLists,1
mov rv,eax
invoke glNewList,rv,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,[esi+edx],[esi+edx+4],[esi+edx+8]
mov edx,tmp_edx
mov ecx,tmp_ecx
add edx,12
dec ecx
jnz @b
invoke glEnd
invoke glEndList
ret
CreateObjectByPolygon endp
Im sure this is right but still, I haven't test it. Im just type what is on my mind.
This should work.
Just be careful with GL_QUAD_STRIP,
if the datas contains vertices grouped by 4 entries (complete squares) you must use GL_QUADS instead.
Quote from: hitchhikr on August 20, 2005, 04:14:17 PM
This should work.
Just be careful with GL_QUAD_STRIP,
if the datas contains vertices grouped by 4 entries (complete squares) you must use GL_QUADS instead.
I made a test for a template from your code.
[attachment deleted by admin]
Add some fix. I will add the camera rotation and text object
[attachment deleted by admin]