Error while importing custom .obj model. #1832
-
Hi @Perksey and @zoalasaurusrawr,
I only changed the model imoprting code at the last line: private static void OnLoad()
{
IInputContext input = window.CreateInput();
primaryKeyboard = input.Keyboards.FirstOrDefault();
if (primaryKeyboard != null)
{
primaryKeyboard.KeyDown += KeyDown;
}
for (int i = 0; i < input.Mice.Count; i++)
{
input.Mice[i].Cursor.CursorMode = CursorMode.Raw;
input.Mice[i].MouseMove += OnMouseMove;
input.Mice[i].Scroll += OnMouseWheel;
}
Gl = GL.GetApi(window);
Shader = new Shader(Gl, "shader.vert", "shader.frag");
Texture = new Texture(Gl, "silk.png");
Model = new Model(Gl, "untitled.model"); // Original code: Model = new Model(Gl, "cube.model"); And it reported this error message:
This is my model file: Thank you for your help in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Have you changed your csproj in response to the renaming of the model file? |
Beta Was this translation helpful? Give feedback.
Hi @Perksey,
Thank you for your help!
It works well now! I changed the suffix of the model file name to be the same in both ".csproj" and "model loading part of code". They should be both ".obj" or ".model".
But the suffix are different in the original example file. It is ".model" in the "model loading part of code" and ".obj" in the ".csproj" file.
This is a bit confusing. Do you know the reason?