Generate a cubes mesh from pixel data NOTE: Vertex data is uploaded to GPU
camera = {position:[4,6,10], target:[0,0,0], up:[0,1,0], fovy:45, projection:raylib.CAMERA_PERSPECTIVE} raylib.InitWindow 800, 600, "GenMeshCubicmap" mapImg = raylib.LoadImage("cubicmap.png") mesh = raylib.GenMeshCubicmap(mapImg, [1,1,1]) model = raylib.LoadModelFromMesh(mesh) raylib.UnloadImage mapImg while not raylib.WindowShouldClose raylib.BeginDrawing raylib.ClearBackground raylib.RAYWHITE raylib.BeginMode3D camera raylib.DrawModel model, [0,0,0], 1.0, raylib.WHITE raylib.EndMode3D raylib.EndDrawing end while raylib.UnloadModel model raylib.CloseWindow
There was an error while loading. Please reload this page.