From 0ee43e786d3297e01ad1fc44bcc85e962edfdee3 Mon Sep 17 00:00:00 2001 From: FixerAlice <69918994+KoishiC@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:16:27 +0800 Subject: [PATCH 1/5] Add some spatial functions --- scripts/SpatialFunctions/SpatialFunctions.gml | 196 ++++++++++++++++++ scripts/SpatialFunctions/SpatialFunctions.yy | 13 ++ 2 files changed, 209 insertions(+) create mode 100644 scripts/SpatialFunctions/SpatialFunctions.gml create mode 100644 scripts/SpatialFunctions/SpatialFunctions.yy diff --git a/scripts/SpatialFunctions/SpatialFunctions.gml b/scripts/SpatialFunctions/SpatialFunctions.gml new file mode 100644 index 00000000..927f0e8d --- /dev/null +++ b/scripts/SpatialFunctions/SpatialFunctions.gml @@ -0,0 +1,196 @@ +//Call it at the beginning for creating the regular vertex format. +function Spatial_InitVertexFormat() { + vertex_format_begin(); + vertex_format_add_position_3d(); + vertex_format_add_color(); + vertex_format_add_texcoord(); + vertex_format_add_normal(); + var format = vertex_format_end(); + return format; +} + +function Model(modelBuffer, transform) constructor { + Buffer = vertex_create_buffer_from_buffer(modelBuffer, vertexFormat); + Transform = transform; +} + +function Vec3(xx, yy, zz) constructor { + X = xx; + Y = yy; + Z = zz; +} + +function TransformData(position, rotation, scale) constructor { + Position = position; + Rotation = rotation; + Scale = scale; +} + +//Add your model files(*.obj only) into the datafiles folder and load them by their names. +function Spatial_LoadModel(fileName, vertexFormat) { + var buffer = buffer_load(fileName); + var content_string = buffer_read(buffer, buffer_text); + buffer_delete(buffer); + + static px = buffer_create(10000, buffer_grow, 4); + static py = buffer_create(10000, buffer_grow, 4); + static pz = buffer_create(10000, buffer_grow, 4); + static nx = buffer_create(10000, buffer_grow, 4); + static ny = buffer_create(10000, buffer_grow, 4); + static nz = buffer_create(10000, buffer_grow, 4); + static tx = buffer_create(10000, buffer_grow, 4); + static ty = buffer_create(10000, buffer_grow, 4); + buffer_seek(px, buffer_seek_start, 4); + buffer_seek(py, buffer_seek_start, 4); + buffer_seek(pz, buffer_seek_start, 4); + buffer_seek(nx, buffer_seek_start, 4); + buffer_seek(ny, buffer_seek_start, 4); + buffer_seek(nz, buffer_seek_start, 4); + buffer_seek(tx, buffer_seek_start, 4); + buffer_seek(ty, buffer_seek_start, 4); + + var lines = string_split(content_string, "\n"); + + var vBuffer = vertex_create_buffer(); + vertex_begin(vBuffer, vertexFormat); + + var i = 0; + repeat (array_length(lines)) { + var this_line = lines[i++]; + if (this_line == "") continue; + + var tokens = string_split(this_line, " "); + + switch (tokens[0]) { + case "v": + buffer_write(px, buffer_f32, real(tokens[1])); + buffer_write(py, buffer_f32, real(tokens[3])); + buffer_write(pz, buffer_f32, real(tokens[2])); + break; + case "vt": + buffer_write(tx, buffer_f32, real(tokens[1])); + buffer_write(ty, buffer_f32, 1 - real(tokens[2])); + break; + case "vn": + buffer_write(nx, buffer_f32, real(tokens[1])); + buffer_write(ny, buffer_f32, real(tokens[3])); + buffer_write(nz, buffer_f32, real(tokens[2])); + break; + case "f": + var n = array_length(tokens); + for (var j = 1; j < n; j++) { + tokens[j] = string_split(tokens[j], "/"); + } + for (var j = 2; j < n; j++) { + var v1 = tokens[1]; + var v2 = tokens[j - 1]; + var v3 = tokens[j]; + + var pi1 = 4 * real(v1[0]); + var pi2 = 4 * real(v2[0]); + var pi3 = 4 * real(v3[0]); + var v1_position_x = buffer_peek(px, pi1, buffer_f32); + var v1_position_y = buffer_peek(py, pi1, buffer_f32); + var v1_position_z = buffer_peek(pz, pi1, buffer_f32); + var v2_position_x = buffer_peek(px, pi2, buffer_f32); + var v2_position_y = buffer_peek(py, pi2, buffer_f32); + var v2_position_z = buffer_peek(pz, pi2, buffer_f32); + var v3_position_x = buffer_peek(px, pi3, buffer_f32); + var v3_position_y = buffer_peek(py, pi3, buffer_f32); + var v3_position_z = buffer_peek(pz, pi3, buffer_f32); + + var v1_normal_x = 0, v1_normal_y = 0, v1_normal_z = 0; + var v2_normal_x = 0, v2_normal_y = 0, v2_normal_z = 0; + var v3_normal_x = 0, v3_normal_y = 0, v3_normal_z = 0; + var v1_texcoord_x = 0, v1_texcoord_y = 0; + var v2_texcoord_x = 0, v2_texcoord_y = 0; + var v3_texcoord_x = 0, v3_texcoord_y = 0; + + switch (array_length(v1)) { + case 2: + var ti = 4 * real(v1[1]); + v1_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v1_texcoord_y = buffer_peek(ty, ti, buffer_f32); + break; + case 3: + if (v1[1] != "") { + ti = 4 * real(v1[1]); + v1_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v1_texcoord_y = buffer_peek(ty, ti, buffer_f32); + } + var ni = 4 * real(v1[2]); + v1_normal_x = buffer_peek(nx, ni, buffer_f32); + v1_normal_y = buffer_peek(ny, ni, buffer_f32); + v1_normal_z = buffer_peek(nz, ni, buffer_f32); + break; + } + switch (array_length(v2)) { + case 2: + var ti = 4 * real(v2[1]); + v2_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v2_texcoord_y = buffer_peek(ty, ti, buffer_f32); + break; + case 3: + if (v2[1] != "") { + ti = 4 * real(v2[1]); + v2_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v2_texcoord_y = buffer_peek(ty, ti, buffer_f32); + } + var ni = 4 * real(v2[2]); + v2_normal_x = buffer_peek(nx, ni, buffer_f32); + v2_normal_y = buffer_peek(ny, ni, buffer_f32); + v2_normal_z = buffer_peek(nz, ni, buffer_f32); + break; + } + switch (array_length(v3)) { + case 2: + var ti = 4 * real(v3[1]); + v3_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v3_texcoord_y = buffer_peek(ty, ti, buffer_f32); + break; + case 3: + if (v3[1] != "") { + ti = 4 * real(v3[1]); + v3_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v3_texcoord_y = buffer_peek(ty, ti, buffer_f32); + } + var ni = 4 * real(v3[2]); + v3_normal_x = buffer_peek(nx, ni, buffer_f32); + v3_normal_y = buffer_peek(ny, ni, buffer_f32); + v3_normal_z = buffer_peek(nz, ni, buffer_f32); + break; + } + + vertex_position_3d(vBuffer, v1_position_x, v1_position_y, v1_position_z); + vertex_normal(vBuffer, v1_normal_x, v1_normal_y, v1_normal_z); + vertex_texcoord(vBuffer, v1_texcoord_x, v1_texcoord_y); + vertex_colour(vBuffer, c_white, 1); + + vertex_position_3d(vBuffer, v2_position_x, v2_position_y, v2_position_z); + vertex_normal(vBuffer, v2_normal_x, v2_normal_y, v2_normal_z); + vertex_texcoord(vBuffer, v2_texcoord_x, v2_texcoord_y); + vertex_colour(vBuffer, c_white, 1); + + vertex_position_3d(vBuffer, v3_position_x, v3_position_y, v3_position_z); + vertex_normal(vBuffer, v3_normal_x, v3_normal_y, v3_normal_z); + vertex_texcoord(vBuffer, v3_texcoord_x, v3_texcoord_y); + vertex_colour(vBuffer, c_white, 1); + } + break; + } + } + + vertex_end(vBuffer); + vertex_freeze(vBuffer); + + var model = new Model(vBuffer, new TransformData(new Vec3(0, 0, 0), new Vec3(0, 0, 0), new Vec3(1, 1, 1))); + vertex_delete_buffer(vBuffer); + + return model; +} + +//You should first create a list with models that share the same camera state +//And then call this function to draw them together +function DrawModels(modelList, cameraProp) { + //TODO +} diff --git a/scripts/SpatialFunctions/SpatialFunctions.yy b/scripts/SpatialFunctions/SpatialFunctions.yy new file mode 100644 index 00000000..98292c08 --- /dev/null +++ b/scripts/SpatialFunctions/SpatialFunctions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"", + "%Name":"SpatialFunctions", + "isCompatibility":false, + "isDnD":false, + "name":"SpatialFunctions", + "parent":{ + "name":"Spatial", + "path":"folders/Scripts/Spatial.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file From 3ec33ec9d895e1f5ae3af7afd7db8aacf381b895 Mon Sep 17 00:00:00 2001 From: FixerAlice <69918994+KoishiC@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:00:04 +0800 Subject: [PATCH 2/5] Update SpatialFunctions.gml --- scripts/SpatialFunctions/SpatialFunctions.gml | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/scripts/SpatialFunctions/SpatialFunctions.gml b/scripts/SpatialFunctions/SpatialFunctions.gml index 927f0e8d..e4031669 100644 --- a/scripts/SpatialFunctions/SpatialFunctions.gml +++ b/scripts/SpatialFunctions/SpatialFunctions.gml @@ -9,9 +9,11 @@ function Spatial_InitVertexFormat() { return format; } -function Model(modelBuffer, transform) constructor { +function Model(modelBuffer, transform, prim = pr_trianglestrip, texture = -1) constructor { Buffer = vertex_create_buffer_from_buffer(modelBuffer, vertexFormat); Transform = transform; + PrimType = prim; + Texture = texture; } function Vec3(xx, yy, zz) constructor { @@ -189,8 +191,36 @@ function Spatial_LoadModel(fileName, vertexFormat) { return model; } +function CameraProp(pos, target, up, fov, aspect, near, far) constructor { + Pos = pos; + Target = target; + Up = up; + Fov = fov; + Aspect = aspect; + ZNear = near; + ZFar = far; +} + //You should first create a list with models that share the same camera state //And then call this function to draw them together function DrawModels(modelList, cameraProp) { - //TODO -} + var cam = camera_get_active(); + + var viewMatPrevious = camera_get_view_mat(cam); + var projMatPrevious = camera_get_proj_mat(cam); + + var viewMat = matrix_build_lookat(cameraProp.Pos.X, cameraProp.Pos.Y, cameraProp.Pos.Z, cameraProp.Target.X, cameraProp.Target.Y, cameraProp.Target.Z, cameraProp.Up.X, cameraProp.Up.Y, cameraProp.Up.Z); + var projMat = matrix_build_projection_perspective_fov(cameraProp.Fov, cameraProp.Aspect, cameraProp.ZNear, cameraProp.ZFar); + + camera_set_view_mat(cam, viewMat); + camera_set_proj_mat(cam, projMat); + + for (var i=0; i Date: Tue, 25 Jun 2024 01:10:14 +0800 Subject: [PATCH 3/5] Update SpatialFunctions.gml --- scripts/SpatialFunctions/SpatialFunctions.gml | 114 ++++++++++-------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/scripts/SpatialFunctions/SpatialFunctions.gml b/scripts/SpatialFunctions/SpatialFunctions.gml index e4031669..fec0579a 100644 --- a/scripts/SpatialFunctions/SpatialFunctions.gml +++ b/scripts/SpatialFunctions/SpatialFunctions.gml @@ -1,18 +1,18 @@ //Call it at the beginning for creating the regular vertex format. function Spatial_InitVertexFormat() { - vertex_format_begin(); + vertex_formatadd_texcoord(); + vertex_format_add_n_begin(); vertex_format_add_position_3d(); vertex_format_add_color(); - vertex_format_add_texcoord(); - vertex_format_add_normal(); - var format = vertex_format_end(); + vertex_format_ormal(); + var format = vertex_ = vertex_create_buffer_from_buffer(modelBuffer, vertexFormat); + Transform = transform; + PrimType = pformat_end(); return format; } function Model(modelBuffer, transform, prim = pr_trianglestrip, texture = -1) constructor { - Buffer = vertex_create_buffer_from_buffer(modelBuffer, vertexFormat); - Transform = transform; - PrimType = prim; + Bufferrim; Texture = texture; } @@ -29,26 +29,26 @@ function TransformData(position, rotation, scale) constructor { } //Add your model files(*.obj only) into the datafiles folder and load them by their names. -function Spatial_LoadModel(fileName, vertexFormat) { - var buffer = buffer_load(fileName); - var content_string = buffer_read(buffer, buffer_text); - buffer_delete(buffer); +function Spatial_LoadM - static px = buffer_create(10000, buffer_grow, 4); - static py = buffer_create(10000, buffer_grow, 4); - static pz = buffer_create(10000, buffer_grow, 4); - static nx = buffer_create(10000, buffer_grow, 4); - static ny = buffer_create(10000, buffer_grow, 4); - static nz = buffer_create(10000, buffer_grow, 4); - static tx = buffer_create(10000, buffer_grow, 4); + sty = buffer_create(10000, buffer_grow, 4);00, buffer_grow, 4); static ty = buffer_create(10000, buffer_grow, 4); buffer_seek(px, buffer_seek_start, 4); buffer_seek(py, buffer_seek_start, 4); buffer_seek(pz, buffer_seek_start, 4); - buffer_seek(nx, buffer_seek_start, 4); + buffer_seek(nx, buffer_seeodel(fileName, vertexFormat) { + var buffer = buffer_load(fileName); + var content_string = buffer_read(buffer, buffer_text); + buffer_delete(buffer);k_start, 4); buffer_seek(ny, buffer_seek_start, 4); buffer_seek(nz, buffer_seek_start, 4); buffer_seek(tx, buffer_seek_start, 4); + static pz = buffer_create(10000, buffer_grow, 4); + static nx = buffer_create(10000, buffer_grow, 4); + static ny = buffer_create(10000, buffer_grow, 4); + static nz = buffer_create(10000, buffer_grow, 4); + static tx = buffer_cnes)) { + var this_line = lines[i++];reate(100 buffer_seek(ty, buffer_seek_start, 4); var lines = string_split(content_string, "\n"); @@ -67,14 +67,16 @@ function Spatial_LoadModel(fileName, vertexFormat) { case "v": buffer_write(px, buffer_f32, real(tokens[1])); buffer_write(py, buffer_f32, real(tokens[3])); - buffer_write(pz, buffer_f32, real(tokens[2])); + bufferatic px = buffer_create(10000, buffer_grow, 4); + static p_write(pz, buffer_f32, real(tokens[2])); break; case "vt": buffer_write(tx, buffer_f32, real(tokens[1])); buffer_write(ty, buffer_f32, 1 - real(tokens[2])); break; case "vn": - buffer_write(nx, buffer_f32, real(tokens[1])); + buffer_write(natic px = buffer_create(10000, buffer_grow, 4); + static px, buffer_f32, real(tokens[1])); buffer_write(ny, buffer_f32, real(tokens[3])); buffer_write(nz, buffer_f32, real(tokens[2])); break; @@ -104,19 +106,28 @@ function Spatial_LoadModel(fileName, vertexFormat) { var v1_normal_x = 0, v1_normal_y = 0, v1_normal_z = 0; var v2_normal_x = 0, v2_normal_y = 0, v2_normal_z = 0; var v3_normal_x = 0, v3_normal_y = 0, v3_normal_z = 0; - var v1_texcoord_x = 0, v1_texcoord_y = 0; + var v1_texcoord_xn_x = buffer_peek(px, pi2, buffer_f32); + var v2_position_y = buffer_peek(py, pi2, buffer_f32); + var v2_position_z = = 0, v1_texcoord_y = 0; var v2_texcoord_x = 0, v2_texcoord_y = 0; var v3_texcoord_x = 0, v3_texcoord_y = 0; switch (array_length(v1)) { case 2: var ti = 4 * real(v1[1]); - v1_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v1_texcoorn_x = buffer_peek(px, pi2, buffer_f32); + var v2_position_y = buffer_peek(py, pi2, buffer_f32); + var v2_position_z = d_x = buffer_peek(tx, ti, buffer_f32); v1_texcoord_y = buffer_peek(ty, ti, buffer_f32); break; + case 3: + if (v1[1] != "") { + ti = 4 v1_texcoord_y = buffer_peek(ty, ti, buffer_f32); + break; case 3: if (v1[1] != "") { ti = 4 * real(v1[1]); + v1_texcoord_x * real(v1[1]); v1_texcoord_x = buffer_peek(tx, ti, buffer_f32); v1_texcoord_y = buffer_peek(ty, ti, buffer_f32); } @@ -134,17 +145,7 @@ function Spatial_LoadModel(fileName, vertexFormat) { break; case 3: if (v2[1] != "") { - ti = 4 * real(v2[1]); - v2_texcoord_x = buffer_peek(tx, ti, buffer_f32); - v2_texcoord_y = buffer_peek(ty, ti, buffer_f32); - } - var ni = 4 * real(v2[2]); - v2_normal_x = buffer_peek(nx, ni, buffer_f32); - v2_normal_y = buffer_peek(ny, ni, buffer_f32); - v2_normal_z = buffer_peek(nz, ni, buffer_f32); - break; - } - switch (array_length(v3)) { + ti = 4 case 2: var ti = 4 * real(v3[1]); v3_texcoord_x = buffer_peek(tx, ti, buffer_f32); @@ -157,15 +158,25 @@ function Spatial_LoadModel(fileName, vertexFormat) { v3_texcoord_y = buffer_peek(ty, ti, buffer_f32); } var ni = 4 * real(v3[2]); - v3_normal_x = buffer_peek(nx, ni, buffer_f32); + v3_normal_x * real(v2[1]); + v2_texcoord_x = buffer_peek(tx, ti, buffer_f32); + v2_texcoord_y = buffer_peek(ty, ti, buffer_f32); + } + var ni = 4 * real(v2[2]); + v2_normal_x = buffer_peek(nx, ni, buffer_f32); + v2_normal_y = buffer_peek(ny, ni, buffer_f32); + v2_normal_z = buffer_peek(nz, ni, buffer_f32); + break; + } + switch (array_length(v3)on_3d(vBuffer, v1_position_x, v1_position_y, v1_position_z); + vertex_normal(vBuffer, v1_normal_x, v1_normal_y, v1_normal_z); + vertex_texcoord(vBuff) {= buffer_peek(nx, ni, buffer_f32); v3_normal_y = buffer_peek(ny, ni, buffer_f32); v3_normal_z = buffer_peek(nz, ni, buffer_f32); break; } - vertex_position_3d(vBuffer, v1_position_x, v1_position_y, v1_position_z); - vertex_normal(vBuffer, v1_normal_x, v1_normal_y, v1_normal_z); - vertex_texcoord(vBuffer, v1_texcoord_x, v1_texcoord_y); + vertex_positier, v1_texcoord_x, v1_texcoord_y); vertex_colour(vBuffer, c_white, 1); vertex_position_3d(vBuffer, v2_position_x, v2_position_y, v2_position_z); @@ -199,17 +210,7 @@ function CameraProp(pos, target, up, fov, aspect, near, far) constructor { Aspect = aspect; ZNear = near; ZFar = far; -} - -//You should first create a list with models that share the same camera state -//And then call this function to draw them together -function DrawModels(modelList, cameraProp) { - var cam = camera_get_active(); - - var viewMatPrevious = camera_get_view_mat(cam); - var projMatPrevious = camera_get_proj_mat(cam); - - var viewMat = matrix_build_lookat(cameraProp.Pos.X, cameraProp.Pos.Y, cameraProp.Pos.Z, cameraProp.Target.X, cameraProp.Target.Y, cameraProp.Target.Z, cameraProp.Up.X, cameraProp.Up.Y, cameraProp.Up.Z); +}ookat(cameraProp.Pos.X, cameraProp.Pos.Y, cameraProp.Pos.Z, cameraProp.Target.X, cameraProp.Target.Y, cameraProp.Target.Z, cameraProp.Up.X, cameraProp.Up.Y, cameraProp.Up.Z); var projMat = matrix_build_projection_perspective_fov(cameraProp.Fov, cameraProp.Aspect, cameraProp.ZNear, cameraProp.ZFar); camera_set_view_mat(cam, viewMat); @@ -218,9 +219,20 @@ function DrawModels(modelList, cameraProp) { for (var i=0; i Date: Tue, 25 Jun 2024 01:11:44 +0800 Subject: [PATCH 4/5] Update SpatialFunctions.yy --- scripts/SpatialFunctions/SpatialFunctions.yy | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/SpatialFunctions/SpatialFunctions.yy b/scripts/SpatialFunctions/SpatialFunctions.yy index 98292c08..869f2e2a 100644 --- a/scripts/SpatialFunctions/SpatialFunctions.yy +++ b/scripts/SpatialFunctions/SpatialFunctions.yy @@ -1,13 +1,7 @@ { - "$GMScript":"", - "%Name":"SpatialFunctions", - "isCompatibility":false, - "isDnD":false, - "name":"SpatialFunctions", - "parent":{ - "name":"Spatial", - "path":"folders/Scripts/Spatial.yy", - }, - "resourceType":"GMScript", - "resourceVersion":"2.0", -} \ No newline at end of file + "$GMScrk8kiptk8":f, + "%Name"myimrk68kkatiag ipts/Spatial.yy", + },rgg + "resourceTukype":"GMScript", + "resourceVerkmujmjhmyfdversujsion":"2.0verbe", +} From 0b06a1a340f0274452f29797c1c2d3f433fc740a Mon Sep 17 00:00:00 2001 From: FixerAlice <69918994+KoishiC@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:26:25 +0800 Subject: [PATCH 5/5] Update SpatialFunctions.gml --- scripts/SpatialFunctions/SpatialFunctions.gml | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/scripts/SpatialFunctions/SpatialFunctions.gml b/scripts/SpatialFunctions/SpatialFunctions.gml index fec0579a..1bc561d4 100644 --- a/scripts/SpatialFunctions/SpatialFunctions.gml +++ b/scripts/SpatialFunctions/SpatialFunctions.gml @@ -1,41 +1,36 @@ -//Call it at the beginning for creating the regular vertex format. -function Spatial_InitVertexFormat() { - vertex_formatadd_texcoord(); +//Call it at the beginning ); vertex_format_add_n_begin(); - vertex_format_add_position_3d(); - vertex_format_add_color(); - vertex_format_ormal(); - var format = vertex_ = vertex_create_buffer_from_buffer(modelBuffer, vertexFormat); - Transform = transform; + vertex_format_arm; PrimType = pformat_end(); return format; } function Model(modelBuffer, transform, prim = pr_trianglestrip, texture = -1) constructor { - Bufferrim; + Bufferfor creating the regular vertex format. +function Spatial_InitVertexFormat() { + vertex_formatadd_texcoord(rim; Texture = texture; } function Vec3(xx, yy, zz) constructor { - X = xx; - Y = yy; - Z = zz; -} - -function TransformData(position, rotation, scale) constructor { + X = xx;dd_position_3d(); + vertex_format_add_color(); + vertex_format_ormal(); + var format = vertex_ = vertex_create_buffer_from_buffer(modelBuffer, vertexFormat); + Transform = transfoData(position, rotation, scale) constructor { Position = position; Rotation = rotation; Scale = scale; } -//Add your model files(*.obj only) into the datafiles folder and load them by their names. -function Spatial_LoadM +//Add yoal_LoadM sty = buffer_create(10000, buffer_grow, 4);00, buffer_grow, 4); static ty = buffer_create(10000, buffer_grow, 4); buffer_seek(px, buffer_seek_start, 4); - buffer_seek(py, buffer_seek_start, 4); - buffer_seek(pz, buffer_seek_start, 4); + buffer_seek(pur model files(*.obj only) into the datafiler_seek_start, 4); + buffer_seek(pz, buffees folder and load them by their names. +function Spatiy, buffr_seek_start, 4); buffer_seek(nx, buffer_seeodel(fileName, vertexFormat) { var buffer = buffer_load(fileName); var content_string = buffer_read(buffer, buffer_text);