Hey! This is an amazing update to the older video, and the addition of the triangulation is much appreciated! Regarding that though, I have a question. At 30:43 you say you should start the for loop at 2, then set it up with tokens[1], tokens[j-1] and tokens[j]. Would that not result in the first face being (1, 1, 2), unlike the diagram you showed just before where the first ace should be (1, 2, 3)? Should the for loop actually start at 3 or am I not understanding something here?
@@DragoniteSpam I am aware of that part yes, but to better illustrate my question it's the following that confuses me: _v1 = _tokens[1], _v2 = _tokens[_j - 1], _v3 = _tokens[_j], starting at j=2, would that not result in: _v1 = _tokens[1], _v2 = _tokens[1], _v3 = _tokens[2], whereas the desired starting point would be _v1 = _tokens[1], _v2 = _tokens[2], _v3 = _tokens[3],
@@DragoniteSpam Thanks for clarifying! As an amateur programmer and game dev, I wasn't sure if there was a hidden meaning behind starting at 2 instead, or not.
This video answers a lot of questions, I'm pretty sure we're not too far from fully functional 3d at this point. I'm gonna start tripping one day when you spawn treasure chests and they actually hit the floor and roll off of one another like in Gmod or Skyrim Great video as always!
im not expecting a response, but when you mentioned about the scale issue i used the same line of code but it made the game window way too big to the point where i could only see the top left portion of it is there any way to scale up the model without scaling the entire window? also theres an issue where some polygons in the model just arent appearing but i cant really get a closer look without the model being larger edit: for now to check the issue i just reimported the model at a larger size (but im still curious if theres a way to do it in gms2) the issue was with the model itself and not the code, the model had polygons with 4 parts (idk what theyre called off the top of my head lol) i just went into blender and added a triangulate modifier to fix it
I'm drawing a cube to the vertex buffer, but i'm getting a bug where some of the faces draw in front of other faces, even when they're supposed to be behind them? Some of the faces just look like weird normals and some look like some 4dimensional shenanigans. It all looks fine in blender though, even checking the normal orientations and it's all blue, made sure to re-map the uv after making sure and it's still all wonky x.x
Thank you for your videos .. I am tried your script on obj exported from 3ds max 21 but its not work because in "v" case obj file have 2 space after v this line correct this if any one need it if (tokens[0]="v") {this_line=string_replace_all(this_line," "," "); tokens = string_split(this_line, " ");}
Sorry for the double post, is it wise to convert quads to tris before importing or is there a work around in Gamemaker's engine, and if so, to what extent does the engine work with a mesh?
your code has a potential problem that it doesn't consider "local uv". Im change this moment in this: var texture_uvs = texture_get_uvs(_texture); vertex_position_3d(vb, v1_position_x, v1_position_y, v1_position_z); vertex_normal(vb, v1_normal_x, v1_normal_y, v1_normal_z); vertex_texcoord(vb, lerp(texture_uvs[0], texture_uvs[2], v1_texcoord_x), lerp(texture_uvs[1], texture_uvs[3], v1_texcoord_y)); vertex_colour(vb, c_white, 1);
you mean textures that live within a bigger GM texture page? technically true, though i usually recommend people put their 3d textures on their own texture pages for ease of use. the texture packer can pack them differently between builds of the game if it wants to, and if you save the vb to a file the uvs could be in a completely different place
Hello, I am getting an error when I try to run the game, it reads : ___________________________________________ ############################################################################################ ERROR in action number 1 of Create Event for object obj_pov: Illegal Buffer Index -1 at gml_Script_import_obj (line 6) - var content_string = buffer_read(buffer , buffer_text); ############################################################################################ gml_Script_import_obj (line 6) gml_Object_obj_pov_Create_0 (line 17) - cube = import_obj("cube.obj", vertex_format); What do I do?
I got this same error, but I think I resolved it. Where are storing your cube object? Try moving the cube object into the Datafiles folder in your project. Don't store it in any subfolder unless you know how to write a path (like "/subfoder/cube.obj" or something).
@@fordroberts1409 Yeah I'm storing the cube in the datafiles section, I've searched online too but not many people have the answers. Thanks for trying.
@@PratibhaIyer-fj6lf I am getting: ERROR in action number 1 of Draw Event for object oCamera: vertex_submit: Illegal vertex buffer specified. at gml_Object_oCamera_Draw_0 (line 26) - vertex_submit(house1, pr_trianglelist, sprite_get_texture(Skull, 0)); ############################################################################################ gml_Object_oCamera_Draw_0 (line 26)
@@synthesisgames looks like we're both getting errors, I don't know what to do. I don't think Dragonite checks for comments on this video anymore, he's probably busy with other projects.
Hey! This is an amazing update to the older video, and the addition of the triangulation is much appreciated! Regarding that though, I have a question.
At 30:43 you say you should start the for loop at 2, then set it up with tokens[1], tokens[j-1] and tokens[j].
Would that not result in the first face being (1, 1, 2), unlike the diagram you showed just before where the first ace should be (1, 2, 3)?
Should the for loop actually start at 3 or am I not understanding something here?
tokens[0] is the "f" part of the line
@@DragoniteSpam I am aware of that part yes, but to better illustrate my question it's the following that confuses me:
_v1 = _tokens[1],
_v2 = _tokens[_j - 1],
_v3 = _tokens[_j],
starting at j=2, would that not result in:
_v1 = _tokens[1],
_v2 = _tokens[1],
_v3 = _tokens[2],
whereas the desired starting point would be
_v1 = _tokens[1],
_v2 = _tokens[2],
_v3 = _tokens[3],
@@gydgeza oh yeah, you'd want to start the loop at 3 then, i should probably update the github
@@DragoniteSpam Thanks for clarifying! As an amateur programmer and game dev, I wasn't sure if there was a hidden meaning behind starting at 2 instead, or not.
I remember the wild west of 3D in GameMaker, back during the pre-yoyo days. Working with OBJs was pure wizardry back then...
This video answers a lot of questions, I'm pretty sure we're not too far from fully functional 3d at this point. I'm gonna start tripping one day when you spawn treasure chests and they actually hit the floor and roll off of one another like in Gmod or Skyrim
Great video as always!
Team Z Up Represent!
im not expecting a response, but when you mentioned about the scale issue i used the same line of code but it made the game window way too big to the point where i could only see the top left portion of it
is there any way to scale up the model without scaling the entire window?
also theres an issue where some polygons in the model just arent appearing but i cant really get a closer look without the model being larger
edit: for now to check the issue i just reimported the model at a larger size (but im still curious if theres a way to do it in gms2)
the issue was with the model itself and not the code, the model had polygons with 4 parts (idk what theyre called off the top of my head lol)
i just went into blender and added a triangulate modifier to fix it
I'm drawing a cube to the vertex buffer, but i'm getting a bug where some of the faces draw in front of other faces, even when they're supposed to be behind them? Some of the faces just look like weird normals and some look like some 4dimensional shenanigans. It all looks fine in blender though, even checking the normal orientations and it's all blue, made sure to re-map the uv after making sure and it's still all wonky x.x
Make sure z write and test is enabled
@@DragoniteSpam Thank you so much :D I had it enabled, but in the wrong draw event lol
Thank you for your videos .. I am tried your script on obj exported from 3ds max 21 but its not work because in "v" case obj file have 2 space after v
this line correct this if any one need it
if (tokens[0]="v") {this_line=string_replace_all(this_line," "," "); tokens = string_split(this_line, " ");}
you can also use the remove_empty argument in string_split
a true pillar of the community.
Hey, where did you explain how the shader works if you did and what code do I need for it? I can’t seem to find it anywhere.
it's just a little directional light:
ruclips.net/video/mspdUDlVEXI/видео.html
Sorry for the double post, is it wise to convert quads to tris before importing or is there a work around in Gamemaker's engine, and if so, to what extent does the engine work with a mesh?
your code has a potential problem that it doesn't consider "local uv".
Im change this moment in this:
var texture_uvs = texture_get_uvs(_texture);
vertex_position_3d(vb, v1_position_x, v1_position_y, v1_position_z);
vertex_normal(vb, v1_normal_x, v1_normal_y, v1_normal_z);
vertex_texcoord(vb, lerp(texture_uvs[0], texture_uvs[2], v1_texcoord_x), lerp(texture_uvs[1], texture_uvs[3], v1_texcoord_y));
vertex_colour(vb, c_white, 1);
vertex_position_3d(vb, v2_position_x, v2_position_y, v2_position_z);
vertex_normal(vb, v2_normal_x, v2_normal_y, v2_normal_z);
vertex_texcoord(vb, lerp(texture_uvs[0], texture_uvs[2], v2_texcoord_x), lerp(texture_uvs[1], texture_uvs[3], v2_texcoord_y));
vertex_colour(vb, c_white, 1);
vertex_position_3d(vb, v3_position_x, v3_position_y, v3_position_z);
vertex_normal(vb, v3_normal_x, v3_normal_y, v3_normal_z);
vertex_texcoord(vb, lerp(texture_uvs[0], texture_uvs[2], v3_texcoord_x), lerp(texture_uvs[1], texture_uvs[3], v3_texcoord_y));
vertex_colour(vb, c_white, 1);
you mean textures that live within a bigger GM texture page? technically true, though i usually recommend people put their 3d textures on their own texture pages for ease of use. the texture packer can pack them differently between builds of the game if it wants to, and if you save the vb to a file the uvs could be in a completely different place
I like game maker , but I don't think it looks reasonable considering that in other game engines it is done in a few clicks
Hello, I am getting an error when I try to run the game, it reads :
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object obj_pov:
Illegal Buffer Index -1
at gml_Script_import_obj (line 6) - var content_string = buffer_read(buffer , buffer_text);
############################################################################################
gml_Script_import_obj (line 6)
gml_Object_obj_pov_Create_0 (line 17) - cube = import_obj("cube.obj", vertex_format);
What do I do?
I got this same error, but I think I resolved it. Where are storing your cube object? Try moving the cube object into the Datafiles folder in your project. Don't store it in any subfolder unless you know how to write a path (like "/subfoder/cube.obj" or something).
@@fordroberts1409 Yeah I'm storing the cube in the datafiles section, I've searched online too but not many people have the answers. Thanks for trying.
@@PratibhaIyer-fj6lf I am getting:
ERROR in
action number 1
of Draw Event
for object oCamera:
vertex_submit: Illegal vertex buffer specified.
at gml_Object_oCamera_Draw_0 (line 26) - vertex_submit(house1, pr_trianglelist, sprite_get_texture(Skull, 0));
############################################################################################
gml_Object_oCamera_Draw_0 (line 26)
@@synthesisgames looks like we're both getting errors, I don't know what to do. I don't think Dragonite checks for comments on this video anymore, he's probably busy with other projects.
@@synthesisgames whatever's stored in "house1" isn't a vertex buffer