Author Topic: X_DRAWBOXAXES  (Read 2347 times)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1640
  • Particle Hawk
    • View Profile
X_DRAWBOXAXES
« on: 2009-Oct-04 »
This is basically exactly like X_DRAWAXES.
The difference is, one additional parameter: w=width of box.
It creates a colored line box at designated width(w), around the xyz.
It also shows all the positive directions using X_DRAWAXES, in the positive corners.
This function is strictly used for 3d environment development, as X_DRAWAXES is also.


Code: (glbasic) [Select]
// =======================================================================//
FUNCTION X_DRAWBOXAXES: x,y,z,w
LOCAL r = w / 2
LOCAL Red  = RGB( 255 , 0 , 0 )
LOCAL Lime = RGB( 0 , 255 , 0 )
LOCAL Blue = RGB( 0 , 0 , 255 )
//x
X_LINE x+r,y+r,z+r , x+-r,y+r,z+r, 1, Red
X_LINE x+r,y+r,z+-r , x+-r,y+r,z+-r, 1, Red
X_LINE x+r,y+-r,z+r , x+-r,y+-r,z+r, 1, Red
X_LINE x+r,y+-r,z+-r , x+-r,y+-r,z+-r, 1, Red
X_DRAWAXES x+r,y+r,z+r
X_DRAWAXES x+r,y+r,z+-r
X_DRAWAXES x+r,y+-r,z+r
X_DRAWAXES x+r,y+-r,z+-r
//y
X_LINE x+r,y+r,z+r , x+r,y+-r,z+r, 1, Lime
X_LINE x+r,y+r,z+-r , x+r,y+-r,z+-r, 1, Lime
X_LINE x+-r,y+r,z+r , x+-r,y+-r,z+r, 1, Lime
X_LINE x+-r,y+r,z+-r , x+-r,y+-r,z+-r, 1, Lime
X_DRAWAXES x+r,y+r,z+r
X_DRAWAXES x+r,y+r,z+-r
X_DRAWAXES x+-r,y+r,z+r
X_DRAWAXES x+-r,y+r,z+-r
//z
X_LINE x+r,y+r,z+r , x+r,y+r,z+-r, 1, Blue
X_LINE x+r,y+-r,z+r , x+r,y+-r,z+-r, 1, Blue
X_LINE x+-r,y+-r,z+r , x+-r,y+-r,z+-r, 1, Blue
X_LINE x+-r,y+r,z+r , x+-r,y+r,z+-r, 1, Blue
X_DRAWAXES x+r,y+r,z+r
X_DRAWAXES x+-r,y+r,z+r
X_DRAWAXES x+r,y+-r,z+r
X_DRAWAXES x+-r,y+-r,z+r
X_DRAWAXES x,y,z

ENDFUNCTION

[attachment deleted by admin]
« Last Edit: 2009-Oct-18 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)