Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rmodels] OBJ model texture not loaded #4328

Closed
Haysher opened this issue Sep 17, 2024 · 3 comments
Closed

[rmodels] OBJ model texture not loaded #4328

Haysher opened this issue Sep 17, 2024 · 3 comments

Comments

@Haysher
Copy link

Haysher commented Sep 17, 2024

Models load in correctly but without textures.

`

#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;

InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera mode");

// Define the camera to look into our 3d world
Camera3D camera = { 0 };
camera.position = (Vector3){ 0.0f, 10.0f, 10.0f };               // Camera position
camera.target = (Vector3){ 0.0f, 1.0f, 0.0f };                   // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };                       // Camera up vector (rotation towards target)
camera.fovy = 45.0f;                                    // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE;                 // Camera mode type
Model ChessBoard = LoadModel("resources/Chessboard.obj");

Vector3 boardPosition = { 0.0f, 2.0f, 0.0f };

SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------

// Main game loop
while (!WindowShouldClose())    // Detect window close button or ESC key
{
    // Update
    //----------------------------------------------------------------------------------
    // TODO: Update your variables here
    //----------------------------------------------------------------------------------

    // Draw
    //----------------------------------------------------------------------------------
    BeginDrawing();

    ClearBackground(RAYWHITE);

    BeginMode3D(camera);

    DrawModel(ChessBoard, boardPosition, 10, WHITE);
    

    DrawGrid(10, 1.0f);

    EndMode3D();

    DrawText("Welcome to the third dimension!", 10, 40, 20, DARKGRAY);

    DrawFPS(10, 10);

    EndDrawing();
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
UnloadModel(ChessBoard);
CloseWindow();        // Close window and OpenGL context
//--------------------------------------------------------------------------------------

return 0;

}`

image

@raysan5
Copy link
Owner

raysan5 commented Sep 19, 2024

@Haysher Please, could you provide the used resources (.obj, .mtl, .png) for testing? You can add them to a .zip and attach the zip to your answer.

@raysan5 raysan5 changed the title [rmodels] Models just load in black. [rmodels] OBJ model texture not loaded Sep 19, 2024
@Haysher
Copy link
Author

Haysher commented Sep 20, 2024 via email

@raysan5
Copy link
Owner

raysan5 commented Sep 24, 2024

Can not test.

@raysan5 raysan5 closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants