GLBasic forum

Main forum => GLBasic - en => Topic started by: bigsofty on 2007-Mar-13

Title: bug in ... X_GETFACE example?
Post by: bigsofty on 2007-Mar-13
Code (glbasic) Select
LOCAL face[]
   X_LOADOBJ "wumbo.ddd", 0

   X_MAKE3D 1,500,45
   X_CAMERA 10,2,-1, 0,2,0
   X_DRAWOBJ 0, 2
   count = X_NUMFACES(0)
   FOR i=0 TO count-1
      X_GETFACE 0, 2, i, face[]
      // face[node 0..2][x,y,z,tx,ty,col]
      X_LINE face[0][0], face[0][1], face[0][2], face[1][0], face[1][1], face[1][2], 4, RGB(0,0,255)
      X_LINE face[2][0], face[2][1], face[2][2], face[1][0], face[1][1], face[1][2], 4, RGB(0,0,255)
      X_LINE face[0][0], face[0][1], face[0][2], face[2][0], face[2][1], face[2][2], 4, RGB(0,0,255)
     
      X_DOT face[0][0], face[0][1], face[0][2], 8, RGB(0,255,0)
      X_DOT face[1][0], face[1][1], face[1][2], 8, RGB(0,255,0)
      X_DOT face[2][0], face[2][1], face[2][2], 8, RGB(0,255,0)
   NEXT

   SHOWSCREEN
   MOUSEWAIT
This line ...
Code (glbasic) Select
  FOR i=0 TO count-1needs to be changed to...
Code (glbasic) Select
  FOR i=0 TO count-1 STEP 3Run it, you can see the difference... could be revealing a bug, as there not strictly dealing with faces...?
Title: bug in ... X_GETFACE example?
Post by: Kitty Hello on 2007-Mar-13
Perfeclty right. Thanks a lot for pointing it out.
Title: bug in ... X_GETFACE example?
Post by: bigsofty on 2007-Mar-14
No problem, Gernot, X_GETFACE is a great little function for sniffing around a model.