Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - mars_chaos89

#1
i have changed it but something else happen...


C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::input_calc()':
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:363: error: no matching function for call to `INC(DGInt&)'
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:394: error: no matching function for call to `DEC(DGInt&)'
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:407: error: no matching function for call to `INC(DGInt&)'
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:422: error: no matching function for call to `DEC(DGInt&)'
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:435: error: no matching function for call to `INC(DGInt&)'
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:454: error: no matching function for call to `DEC(DGInt&)'
C:\DOCUME~1\CBM\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:467: error: no matching function for call to `INC(DGInt&)'



this error come up..


i also have see what your program do...but that not exactly what i want to do...

Code (glbasic) Select
SYSTEMPOINTER TRUE
SETSCREEN 900,700,TRUE

TYPE coord
x
y
z
ENDTYPE

GLOBAL xmark[] AS coord
DIM xmark[10]

MOUSESTATE x,y,mbl,mbr

xmark[i].x = x
xmark[i].y = y
xmark[i].z = z

n=0
LOADSPRITE "../../3d viewer v2/3d viewer v2.app/donut.bmp", 1
X_LOADOBJ "../../3d viewer v2/3d viewer v2.app/donut.ddd", 1
X_LOADOBJ "../xmark.ddd",m


main:

WHILE TRUE
MOUSESTATE x,y,mbl,mbr

// make3ddonut()
make3dmarking(n)

GETSCREENSIZE width,height
centerx = width/2
centery = height/2
PRINT "x="+ x, 100,100
PRINT "y="+ y, 100,120
PRINT "width ="+ width, 100,140
PRINT "height ="+ height, 100,160
PRINT "center point = "+ centerx + " , " + centery, 100,180
PRINT "xmark(" + m +") : x ="+ xmark[m].x + " , y ="+ xmark[m].y + " , z ="+ xmark[m].z, 100,220

SHOWSCREEN

WEND

END

FUNCTION make3dmarking:m

MOUSESTATE x,y,mbl,mbr


X_MAKE3D 1,10000,45
X_CAMERA 10,0,0, 0,0,0


IF KEY(45)=TRUE //x
dirx=(dirx-KEY(203))
dirx=(dirx+KEY(205))
ENDIF
IF KEY(44)=TRUE //z
dirz=(dirz-KEY(208))
dirz=(dirz+KEY(200))
ENDIF
IF KEY(21)=TRUE //y
diry=(diry+KEY(200))
diry=(diry-KEY(208))
ENDIF

X_MOVEMENT dirz, diry, dirx

IF mbl=TRUE
X_SCREEN2WORLD x,y,0, wx,wy,wz
xmark[m].x=wx
xmark[m].y=wy
xmark[m].z=wz
ENDIF

X_MOVEMENT wx,wy,wz
X_SCALING 0.04,0.04,0.04
X_ROTATION 90, 0,1,0

X_DRAWOBJ m,0

X_MAKE2D
PRINT "xmark(1) : x ="+ wx + " , y ="+ wy + " , z ="+ wz, 100,200
//PRINT "xmark(" + m +") : x ="+ xmark[m].x + " , y ="+ xmark[m].y + " , z ="+ xmark[m].z, 100,220


ENDFUNCTION

FUNCTION make3ddonut:

INC phi, MOUSEAXIS(0)

X_MAKE3D 1,10000,45
X_CAMERA 10,0,0, 0,0,0
X_SCALING 0.1,0.1,0.1
X_ROTATION phi, 0,1,0

X_SETTEXTURE 1, -1
X_DRAWOBJ 1,0

ENDFUNCTION


this is my full code...what i want to do is put the 'x' mark on that donut model as many as we want...and save it...


[attachment deleted by admin]
#2
"3d selection.gbas"(23) error : syntax error

this is the error....
#3
i hav try execute the code..but it some error occur....

Code (glbasic) Select
CONSTANT KEY_SPACE=57
CONSTANT KEY_X=45
CONSTANT KEY_Y=21
CONSTANT KEY_Z=44
CONSTANT KEY_LEFT=203
CONSTANT KEY_RIGHT=205
CONSTANT KEY_UP=200
CONSTANT KEY_DOWN=208


ti show that the error is here.....
#4
i have reach this point...

Code (glbasic) Select
TYPE coord
      x
      y
      z
ENDTYPE

   GLOBAL xmark[] AS coord
   DIM xmark[10]

   MOUSESTATE x,y,mbl,mbr

   xmark.x = x
   xmark.y = y
   xmark.z = z

       // load the x mark

main:

   WHILE TRUE
      MOUSESTATE x,y,mbl,mbr
     
   //   make3ddonut()
     

      make3dmarking(i)
     
   
      SHOWSCREEN

   WEND

END

FUNCTION make3dmarking:m

      MOUSESTATE x,y,mbl,mbr
      X_MAKE3D 1,10000,45
      X_CAMERA 10,0,0,   0,0,0



      IF KEY(45)=TRUE               //x
         dirx=(dirx-KEY(203))
         dirx=(dirx+KEY(205))
      ENDIF
      IF KEY(44)=TRUE               //z
         dirz=(dirz-KEY(208))
         dirz=(dirz+KEY(200))
      ENDIF
      IF KEY(21)=TRUE               //y
         diry=(diry+KEY(200))
         diry=(diry-KEY(208))
      ENDIF

      X_MOVEMENT dirz, diry, dirx

         IF mbl=TRUE
            X_SCREEN2WORLD x,y,0,   wx,wy,wz
         ENDIF
         
      X_MOVEMENT wx,wy,wz
      X_SCALING 0.04,0.04,0.04
      X_ROTATION 90, 0,1,0

      X_DRAWOBJ m,0

      X_MAKE2D
      PRINT "xmark(1) :   x ="+ wx + " , y ="+ wy + " , z ="+ wz, 100,200
ENDFUNCTION


at the moment i try to draw 10 'x' that why the dimension is 10....
let say i want to use just a constraint first rather than jumping directly to what i have plan for my application...
so i just try to make the xmark is drawn only when the "m" button is pressed...so i have tried :

a)
Code (glbasic) Select
if key(50)=true
     make3dmarking(n)
endif


this command work but the xmark only appear when the "m" button is pressed and hold...if the we release the button, the xmark will disappear...so there will only be 1 'x'..

b)

Code (glbasic) Select
if key(50)= true
  i=i+1
endif

make3dmarking(i)

i execute this but nothing appeared...

this is as far i get right now...im still trying...any help?
#5
sorry..i dont know how to use it
#6
i have reach this point...

TYPE coord
      x
      y
      z
ENDTYPE

   GLOBAL xmark[] AS coord
   DIM xmark[10]

   MOUSESTATE x,y,mbl,mbr

   xmark.x = x
   xmark.y = y
   xmark.z = z

       // load the x mark

main:

   WHILE TRUE
      MOUSESTATE x,y,mbl,mbr
      
   //   make3ddonut()
      

      make3dmarking(i)
      
   
      SHOWSCREEN

   WEND

END

FUNCTION make3dmarking:m

      MOUSESTATE x,y,mbl,mbr
      X_MAKE3D 1,10000,45
      X_CAMERA 10,0,0,   0,0,0



      IF KEY(45)=TRUE               //x
         dirx=(dirx-KEY(203))
         dirx=(dirx+KEY(205))
      ENDIF
      IF KEY(44)=TRUE               //z
         dirz=(dirz-KEY(208))
         dirz=(dirz+KEY(200))
      ENDIF
      IF KEY(21)=TRUE               //y
         diry=(diry+KEY(200))
         diry=(diry-KEY(208))
      ENDIF

      X_MOVEMENT dirz, diry, dirx

         IF mbl=TRUE
            X_SCREEN2WORLD x,y,0,   wx,wy,wz
         ENDIF
         
      X_MOVEMENT wx,wy,wz
      X_SCALING 0.04,0.04,0.04
      X_ROTATION 90, 0,1,0

      X_DRAWOBJ m,0

      X_MAKE2D
      PRINT "xmark(1) :   x ="+ wx + " , y ="+ wy + " , z ="+ wz, 100,200
ENDFUNCTION


at the moment i try to draw 10 'x' that why the dimension is 10....
let say i want to use just a constraint first rather than jumping directly to what i have plan for my application...
so i just try to make the xmark is drawn only when the "m" button is pressed...so i have tried :

a)
if key(50)=true
     make3dmarking(n)
endif


this command work but the xmark only appear when the "m" button is pressed and hold...if the we release the button, the xmark will disappear...so there will only be 1 'x'..

b)

if key(50)= true
  i=i+1
endif

make3dmarking(i)

i execute this but nothing appeared...

this is as far i get right now...im still trying...
 


#7
ouhhhh....tq ocean...
#8
im a bit lost here....what the difference between non-dynamic and dynamic object?some examples perhaps...
#9
there is no constraint on how many the user can put the cross..so how can i preload it so that i there wont be any limit?
#10
hello everybody...im trying to load several same 3d model into my application...these are the outline of what i want to do:

user push keyboard button [m] ----->the user went into the mode for loading the model...
     if mouse left button is click then
         the 3d model is load
     endif
the user push again keyboard button [m] ------>the user left the mode...

need some idea on how to code this....
     
#11
tq...solve my problem
#12
how can control a 3d model using the mouse?

right now im using :

mousestate x,y,mbl,mbr
x_screen2world x,y,0,   wx,wy,wz

if mbl=true then
  x_movement wx,wy,wz
endif

the problem with this is that the model is following the mouse only when i hold the left button but when i release it when back to its original place...how can i make the model to stay at the position when i move it after i release the mouse button?
#13
GLBasic - en / Re: 3d model
2010-Oct-12
X_SCREEN2WORLD x,y,0,   wx,wy,wz

IF mbl=TRUE
   X_MOVEMENT wx,wy,wz
ENDIF

when i use if my application become like this :

the marking model is appear only when the left mouse button is hold and it disappear when i released the left button....
it does follow the mouse when it appear....
how can i do to make the model still there when i released the button?
#14
GLBasic - en / Re: 3d model
2010-Oct-07
ok my bad.....it is being scale...sorry2 for bothering you.....
#15
GLBasic - en / Re: 3d model
2010-Oct-07
i have test the command and for the time being i just make the 'x' model to follow the pointer at the start of the program and it follow it...

i have an inquiry to ask....

i use x_movement after i use x_screen2world to make the model follow the pointer...but when i use the x_movement command my x_scaling did not work..it does not shrink the model...why is it happening?

i ahve try several ways to solve it but it still the same...

first :

x_movement mx,my,mz
x_scaling 0.2,0.2,0.2
x_rotation 90, 0,1,0

2nd :

x_scaling 0.2,0.2,0.2
x_movement mx,my,mz
x_rotation 90, 0,1,0