Closed ghost closed 1 year ago
Where is the assets folder in your project? Are you able to load other resources from it or is the issue only with vox models?
In your case it looks like the file loaded successfully but the VOX data did not. That looks like a formatting issue. I couldn’t reproduce this bug:
using Raylib_cs;
using System.Numerics;
Raylib.InitWindow(3000, 1800, "Hello World!");
Raylib.SetTargetFPS(60);
Model model = Raylib.LoadModel("Chicken.vox");
Camera3D camera = new(
new Vector3(0f, 2f, 10f),
new Vector3(5f, 0f, 0f),
Vector3.UnitY,
90f,
CameraProjection.CAMERA_PERSPECTIVE);
while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();
Raylib.BeginMode3D(camera);
Raylib.DrawModel(model, default, 1f, Color.WHITE);
Raylib.EndMode3D();
Raylib.EndDrawing();
}
Raylib.UnloadModel(model);
INFO: FILEIO: [Chicken.vox] File loaded successfully INFO: MODEL: [Chicken.vox] VOX data loaded successfully : 5512 vertices/1 meshes INFO: VAO: [ID 2] Mesh uploaded successfully to VRAM (GPU) Chicken.zip
sory that i too late The VOX data really doesn't load, although the model itself loads without problems But i noticed that this is not only a problem of CS version, i tried it with C++ and doesn't work too However with C (and mcvs) it's work succesful
C++ version:
C# work tree
@SerikTamerlan, if you open Bob.vox in notepad are the first 5 characters “VOX -” or “VOX È” or neither? If it’s “VOX È” I would suggest trying to export Bob differently, so it shows as “VOX -”. I have never used MagicaVoxel, however I’m certain the fifth character is the version number. Its 150 ‘-‘ or 200 ‘È’. If you could play around with the settings so it exports as “VOX -” it should work. As a last resort you can try to write a ‘-‘ where the ‘È’ was to force down the version.
@ChrisDill, If I’m correct with my assumptions this pr Addition of support for vox files in version 200. by Bigfoot71 · Pull Request #3097 · raysan5/raylib (github.com) back in June should “fix” this problem. It would explain why Sarik got his models to work in C, however I’m still confused as to why it wouldn’t work in C++.
Hi ! Well when i open file with notepad, i seen just "VOX" and other characters, not "VOX -" , perhaps it's problem with encoding, however it's doesn't work. Also i made new vox model and export it with "VOX" format, but doen't work too
Now i'm thinking that i weired somthing wrong, so it doen't work
Your vox file in order to load properly needs to pass the two checks shown in the link:
To be clear it returns an invalid format error if the first four bytes aren't the string "VOX " <- including the space.
It will also return a file version error if the next 4 bytes are not (uint)150
.
So if your file does not start with "VOX -000" including all the spaces (the last 3 are null characters '\0'
). You will continue to run into this issue.
Hope this helps :/
hello ! i started to writing game with raylib cs but when i started loading model (vox format) , i watched just a white cube in the middle of scene and in the console i seen this:
code:
using Raylib_cs; using System.Numerics;
namespace Other { static class Programm { public static void Main() { Raylib.InitWindow(1000, 800, "hello world !");
}
p.s. i downloaded a library with Nuget and i use vs code