X_OBJNEWFRAME

Previous topic - Next topic

Hemlos


X_OBJSTART ID

X_OBJADDVERTEX
X_OBJNEWGROUP
X_OBJADDVERTEX

X_OBJNEWFRAME //increment to the next frame #

X_OBJADDVERTEX
X_OBJNEWGROUP
X_OBJADDVERTEX

X_SAVEOBJ Name$

Make the command so it is used exactly like OBJNEWGROUP
Bing ChatGpt is pretty smart :O

Kitty Hello

Nice idea. I would make a X_DRAW_WIRE instead, though. Because it's really hard to mix wireframe and triangles in one model.

Hemlos

Thats too bad, im not sure i completely understand what a Draw_Wire will do.
My idea wass to use the bezier library to make some really cool animated objects in GLBasic...like water surfaces etc

Bing ChatGpt is pretty smart :O

Kitty Hello

Yes. And I thought it would be cool to have a mode where you can create a model, but instead of triangles the connected lines are drawn as lines. I see what you mean. With triangles some lines are drawn twice... Hmm....

Hemlos

Err, again, i dont think i understand what you mean....im not an opengl expert like you.
How is this related to drawing multiple frames?

To draw lines, i already did this with X_LINE and X_GETFACE, in the 3dobjectanalyzer and its slow.

Quentin found a wireframe mode in opengl, looks easy enough to implement(which i will add to the 3doa one of these days) :
http://www.glbasic.com/forum/index.php?topic=3730.msg27127#msg27127

Bing ChatGpt is pretty smart :O

Kitty Hello

Yes, that's what I'll do.

Ruidesco

Apologies for reviving a long dead thread, but it's on the first page and it would be redundant to make a different one to ask for the same.

Is this feature going to be implemented sometime?
Defining multiple frames for 3D objects created at runtime is the only thing missing in the "X_OBJ" list of commands, since it is already possible to load objects made with external utilities which have multiple frames.
Personally it would be a lifesaver, since I am using a simple format of my own (I'm trying to make something voxel-related).

Kitty Hello

ok, on the todo.

Ruidesco

Thank you Kitty! *eager* *eager*

mentalthink

Well drawlines in 3D objects I think it´s cool, the utility can be for a retro-intro like Aliens of something esquematics, I think not it´s a bad idea, the most part of 3D suites can show the lines, and another utility if you make a 3D modeler, it´s very important have this point for know in what part of the model you are...

But make water and distortion objects can be very great...

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.

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

#13
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
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Kitty Hello

Code (glbasic) Select

// 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


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.