Feature request > 3D

X_OBJNEWFRAME

<< < (3/4) > >>

Kitty Hello:
I think about adding a wireframe mode.

erico:

--- Quote from: Kitty Hello on 2011-Oct-18 ---I think about adding a wireframe mode.

--- End quote ---

it would be wonderful, like ELITE or AIR SUPPORT!!

Kitty Hello:
Elite - IIRC - has a hidden-line wireframe mode. That's different. You can do this with proper texturing now. Otherwise you would have to draw a solid black object and overlay the wireframe.

Hatonastick:
The suggested above commands are an absolute must for my main game idea which will be retro 3D in appearance.  I really need to be able to mix in wireframe (not hidden-line wireframe) and to be able to procedurally generate simple objects and animate them.  No rush though, wont be starting on that until after my first project.  =D

Kitty Hello:

--- Code: ---// Simple 3D
LOCAL phi

DRAWRECT 0,0,64,64,RGB(255,255,0)
DRAWRECT 10,10,23,23,RGB(0,0,255)
PRINT "GLBASIC", 0,32
GRABSPRITE 0, 0,0,64,64


MakeObjectA(1)
MakeObjectB(2)


WHILE TRUE
phi=GETTIMERALL() * 0.10

X_MAKE3D 1, 2500, 45
X_CAMERA 0,0,120, 0,0,0

// cullmodes -1; 0; +1
FOR cmode=-1 TO 1
IF cmode
X_SETTEXTURE 0, -1
ELSE
X_SETTEXTURE -1, -1
ENDIF
X_CULLMODE cmode
X_MOVEMENT cmode * 50, 0, 0
X_ROTATION phi, 0, 1, 0
X_DRAWOBJ 1, 0
NEXT

// draw an user-created animated object.
X_CULLMODE 0
X_MOVEMENT 0,-30,0
X_DRAWANIM 2, 0, 2, FMOD(GETTIMERALL()/2000., 1.0), TRUE

SHOWSCREEN
WEND




FUNCTION MakeObjectA: id%
// simple polygon shaped 3D object
X_OBJSTART id%
X_OBJADDVERTEX   40,  0, -50,  1,1, RGB(255,255,255)
X_OBJADDVERTEX   40, 40, -50,  1,0, RGB(  0,255,  0)

X_OBJADDVERTEX   30,  0, -20,  0,1, RGB(255,255,255)
X_OBJADDVERTEX   30, 40, -20,  0,0, RGB(  0,255,  0)

X_OBJADDVERTEX   20,  0, 0,  0,1, RGB(255,255,255)
X_OBJADDVERTEX   20, 40, 0,  0,0, RGB(  0,255,  0)
X_OBJADDVERTEX  -20,  0, 0,  1,1, RGB(  0,  0,255)
X_OBJADDVERTEX  -20, 40, 0,  1,0, RGB(  0,  0,255)
X_OBJEND
ENDFUNCTION




FUNCTION MakeObjectB: id%
// simple polygon shaped 3D object, with 3 animation frames
LOCAL col%  =RGB(255,255,255)
X_OBJSTART id%
FOR fr% = 0 TO 2
X_OBJSETFRAME fr%

X_OBJADDVERTEX   0,     0,0,   0.5, 0, col%
X_OBJADDVERTEX  30,-fr*10,0,  1  , 1, col%
X_OBJADDVERTEX -30,-fr* 5,0,   0  , 1, col%
NEXT
X_OBJEND
ENDFUNCTION

--- End code ---

Sorry, I didn't plan to bring the update w/o a proper setup and the iOS compiler, but serious bugs forced me to. Above is the "simple3d" example that will be shipped next.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version