bmp1:
  rb (bmp32)+width*height*4 && bmp32 bmp1 width height

cam1:
  rb camera && camera cam1 bmp1  360 360 360  (-180)(-180)(-180)  0 0 0



;define circles
ensure: rb 1024*point.szStruc
circle.radius=120

c1=ensure
circle.dest=c1
circle.x_rotate=00
call circle
c1.nodesCount = circle.numWritten

c2=circle.dest$
circle.dest=c2
circle.x_rotate=90
call circle
c2.nodesCount = circle.numWritten

roto:
DrawOff;SYNC.bmp32.screen.disable

;project onto bitmap in memory
DrawAsLines c1.nodesCount c1 cam1 0xAA'00'aa
DrawAsLines c2.nodesCount c2 cam1 0xff'ff'00
;show on screen
bmp32.screen bmp1
DrawOff;SYNC.bmp32.screen.disable

RotateCamera cam1 1 2 1
bmp32.flush bmp1 0x00'00'00
if f08[cam1+camera.x_rotate]=0
   sleep 1000
endif

sleep .delay
.delay = 1000/25
goto roto

ret




circle:
  ;HINT: var_writes executed before runtime too
  goto .donot_overwrite_defaults_in_runtime
    ;(optional) vars (not changed on exit)
    .dest=
    .inaccuracy=15
    .radius=1

    .x_shift=0
    .y_shift=0
    .z_shift=0

    .x_rotate=0
    .y_rotate=0
    .z_rotate=0
  ;HINT: ... or you could call circle.do
  .do:
  .donot_overwrite_defaults_in_runtime:

  ;on exit the field contains num points written
  .numWritten=

  ;create a circle at x0y0
  .dest$=.dest
  .degree=0
  while .degree<361
    f08[.dest$+point.x]=.radius*cos(deg2rad .degree)
    f08[.dest$+point.y]=.radius*sin(deg2rad .degree)
    f08[.dest$+point.z]=0
    .dest$=.dest$+point.szStruc
    .degree=.degree+.inaccuracy
  end while
  .numWritten=(.dest$-.dest)/point.szStruc

  ;some gizmo take params byRef
  .aPoint: f08 ,,

  ;rotate the circle at x0y0z0
  f08[.aPoint+point.x]=0
  f08[.aPoint+point.y]=0
  f08[.aPoint+point.z]=0
  RotatePointsOverX .numWritten .dest .aPoint .x_rotate
  RotatePointsOverY .numWritten .dest .aPoint .y_rotate
  RotatePointsOverZ .numWritten .dest .aPoint .z_rotate

  ;shift the circle from x0y0z0
  f08[.aPoint+point.x]=.x_shift
  f08[.aPoint+point.y]=.y_shift
  f08[.aPoint+point.z]=.z_shift
  ShiftPoints .numWritten .dest .aPoint

  ;OllyDbg best debugger ever
  ret
