daz
|
|
Posted on: September 08, 2013, 05:14:31 pm |
|
|
Joined: Jul 2010
Posts: 167
|
I was playing around trying to get a very basic 3d scene setup for testing, and the code below works in GM but not Enigma for some reason and I can't figure out why. Create event: d3d_start(); d3d_set_lighting(1);
x = -20; y = -20; z = 10;
d3d_light_enable(1, true); d3d_light_define_point(1, -10, -10, 12, 200, c_white);
Draw event: draw_set_color(c_white); d3d_set_projection(x, y, z, 0, 0, 0, 0, 0, 1); d3d_draw_block(-5, -5, -5, 5, 5, 5, background_get_texture(background0), 1, 1);
Results: http://i.imgur.com/8hEnWoI.pngI can post project files if they're really necessary. Both used the same texture, named the same. On the enigma side I tried changing camera distance and setting texture to -1 as well as switching rendering engines (OGL1/3, DX9) but I could never see anything... And yes I added the object to the room.
|
|
|
Logged
|
|
|
|
time-killer-games
|
|
Reply #1 Posted on: September 08, 2013, 05:35:32 pm |
|
|
"Guest"
|
I think I remember trying d3d_draw_block before and I got the same issues, you should try d3d_model_block and d3d_model_draw I tested this and it worked, but in case I remembered wrong, what I am completely certain of that works is using the vertex and normals functions to make that equivalent cube, also loading external model files I confirm works because my current project uses this a ton.
Also it would make things easier on you when reproducing that cube model by using GM Model Creator, VModeler, SivModeler etc. These can be found on the YYG sandbox and at the Steam workshop.
|
|
« Last Edit: September 08, 2013, 05:39:55 pm by time-killer-games »
|
Logged
|
|
|
|
daz
|
|
Reply #2 Posted on: September 08, 2013, 07:18:59 pm |
|
|
Joined: Jul 2010
Posts: 167
|
Ah, interesting. Based on that hint, the below does work in enigma:
cube = d3d_model_create(); d3d_model_block(cube, -5, -5, -5, 5, 5, 5, 1, 1, true); d3d_model_draw(cube, 0, 0, 0, background_get_texture(background0));
Also in enigma, d3d_model_block has one extra parameter, and will not work with NPO2 textures like GM will.
|
|
|
Logged
|
|
|
|
time-killer-games
|
|
Reply #3 Posted on: September 08, 2013, 10:14:06 pm |
|
|
"Guest"
|
So I guess at least until these bugs are solved you'll have to use the vertex/normals functions. GM Model creator has this nice feature that can create a cube, select it and then convert the faces to triangles and export to gml, which should help. :-)
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #4 Posted on: September 08, 2013, 11:41:03 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Whens the last time you guys updated the engine? Also, daz, non power of two textures is a limitation of the graphics API Direct3D and OpenGL just don't know how to handle them, so the GPU fills the textures with extra space.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
daz
|
|
Reply #5 Posted on: September 09, 2013, 09:02:32 am |
|
|
Joined: Jul 2010
Posts: 167
|
Whens the last time you guys updated the engine? Also, daz, non power of two textures is a limitation of the graphics API Direct3D and OpenGL just don't know how to handle them, so the GPU fills the textures with extra space.
I downloaded enigma yesterday from the Windows portable exe. Also, this does not work in Enigma (drawing lines) d3d_set_lighting(false); d3d_primitive_begin(pr_linelist); d3d_vertex_color(0, 0, -100, c_blue, 1); d3d_vertex_color(0, 0, 100, c_blue, 1); d3d_vertex_color(-100, 0, 0, c_red, 1); d3d_vertex_color(100, 0, 0, c_red, 1); d3d_vertex_color(0, -100, 0, c_green, 1); d3d_vertex_color(0, 100, 0, c_green, 1); d3d_primitive_end();
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #6 Posted on: September 09, 2013, 09:41:45 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
@daz go to Build->Settings select the "API" tab and try different Graphics Systems. The only ones I was aware of being broke were d3d_primivitive in OGL 3.0 for some reason my model class don't like buffering them, I haven't looked into it yet.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #8 Posted on: September 09, 2013, 01:28:37 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Hrm, try one of these examples from the EDC that are 3D... http://enigma-dev.org/edc/games.php?action=list
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #10 Posted on: September 09, 2013, 01:58:11 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
? No the vector conversion example uses a d3d model for the line grid, draw_line is used to point to the corners and draw text, but it definitely uses a pr_linelist and I just downloaded and test it and it works fine.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #12 Posted on: September 09, 2013, 02:58:23 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
@daz, yes you should create a model before adding a primitive to it, but as for d3d_primitive and draw_primitive, those are not supposed to require you to create a model, I was only aware of them being broke in OpenGL 3 because my model class buffers and then clears them wrong somehow, but it should work in OpenGL 1 without creating a model.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|