mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Update enum/color names to match C# naming convention (#224)
This commit is contained in:
@ -39,11 +39,11 @@ public class AnimationDemo
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
Model model = LoadModel("resources/models/iqm/guy.iqm");
|
||||
Texture2D texture = LoadTexture("resources/models/iqm/guytex.png");
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
Vector3 position = new(0.0f, 0.0f, 0.0f);
|
||||
// Load animation data
|
||||
@ -59,10 +59,10 @@ public class AnimationDemo
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
|
||||
UpdateCamera(ref camera, CameraMode.Free);
|
||||
|
||||
// Play animation when spacebar is held down
|
||||
if (IsKeyDown(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyDown(KeyboardKey.Space))
|
||||
{
|
||||
animFrameCounter++;
|
||||
UpdateModelAnimation(model, anims[0], animFrameCounter);
|
||||
@ -76,7 +76,7 @@ public class AnimationDemo
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
@ -86,21 +86,21 @@ public class AnimationDemo
|
||||
new Vector3(1.0f, 0.0f, 0.0f),
|
||||
-90.0f,
|
||||
new Vector3(1.0f, 1.0f, 1.0f),
|
||||
Color.WHITE
|
||||
Color.White
|
||||
);
|
||||
|
||||
for (int i = 0; i < model.BoneCount; i++)
|
||||
{
|
||||
var framePoses = anims[0].FramePoses;
|
||||
DrawCube(framePoses[animFrameCounter][i].Translation, 0.2f, 0.2f, 0.2f, Color.RED);
|
||||
DrawCube(framePoses[animFrameCounter][i].Translation, 0.2f, 0.2f, 0.2f, Color.Red);
|
||||
}
|
||||
|
||||
DrawGrid(10, 1.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, 10, 20, Color.MAROON);
|
||||
DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
|
||||
DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, 10, 20, Color.Maroon);
|
||||
DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -31,7 +31,7 @@ public class BillboardDemo
|
||||
camera.Target = new Vector3(0.0f, 2.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Our texture billboard
|
||||
Texture2D bill = LoadTexture("resources/billboard.png");
|
||||
@ -66,7 +66,7 @@ public class BillboardDemo
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
|
||||
UpdateCamera(ref camera, CameraMode.Orbital);
|
||||
rotation += 0.4f;
|
||||
distanceStatic = Vector3.Distance(camera.Position, billPositionStatic);
|
||||
distanceRotating = Vector3.Distance(camera.Position, billPositionRotating);
|
||||
@ -75,7 +75,7 @@ public class BillboardDemo
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
@ -84,7 +84,7 @@ public class BillboardDemo
|
||||
// Draw order matters!
|
||||
if (distanceStatic > distanceRotating)
|
||||
{
|
||||
DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.WHITE);
|
||||
DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.White);
|
||||
DrawBillboardPro(
|
||||
camera,
|
||||
bill,
|
||||
@ -94,7 +94,7 @@ public class BillboardDemo
|
||||
new Vector2(1.0f, 1.0f),
|
||||
rotateOrigin,
|
||||
rotation,
|
||||
Color.WHITE
|
||||
Color.White
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -108,9 +108,9 @@ public class BillboardDemo
|
||||
new Vector2(1.0f, 1.0f),
|
||||
rotateOrigin,
|
||||
rotation,
|
||||
Color.WHITE
|
||||
Color.White
|
||||
);
|
||||
DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.WHITE);
|
||||
DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.White);
|
||||
}
|
||||
|
||||
EndMode3D();
|
||||
|
@ -31,11 +31,11 @@ public class BoxCollisions
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
Vector3 playerPosition = new(0.0f, 1.0f, 2.0f);
|
||||
Vector3 playerSize = new(1.0f, 2.0f, 1.0f);
|
||||
Color playerColor = Color.GREEN;
|
||||
Color playerColor = Color.Green;
|
||||
|
||||
Vector3 enemyBoxPos = new(-4.0f, 1.0f, 0.0f);
|
||||
Vector3 enemyBoxSize = new(2.0f, 2.0f, 2.0f);
|
||||
@ -55,19 +55,19 @@ public class BoxCollisions
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Move player
|
||||
if (IsKeyDown(KeyboardKey.KEY_RIGHT))
|
||||
if (IsKeyDown(KeyboardKey.Right))
|
||||
{
|
||||
playerPosition.X += 0.2f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_LEFT))
|
||||
else if (IsKeyDown(KeyboardKey.Left))
|
||||
{
|
||||
playerPosition.X -= 0.2f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_DOWN))
|
||||
else if (IsKeyDown(KeyboardKey.Down))
|
||||
{
|
||||
playerPosition.Z += 0.2f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_UP))
|
||||
else if (IsKeyDown(KeyboardKey.Up))
|
||||
{
|
||||
playerPosition.Z -= 0.2f;
|
||||
}
|
||||
@ -97,28 +97,28 @@ public class BoxCollisions
|
||||
|
||||
if (collision)
|
||||
{
|
||||
playerColor = Color.RED;
|
||||
playerColor = Color.Red;
|
||||
}
|
||||
else
|
||||
{
|
||||
playerColor = Color.GREEN;
|
||||
playerColor = Color.Green;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
// Draw enemy-box
|
||||
DrawCube(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.GRAY);
|
||||
DrawCubeWires(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.DARKGRAY);
|
||||
DrawCube(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.Gray);
|
||||
DrawCubeWires(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.DarkGray);
|
||||
|
||||
// Draw enemy-sphere
|
||||
DrawSphere(enemySpherePos, enemySphereSize, Color.GRAY);
|
||||
DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, Color.DARKGRAY);
|
||||
DrawSphere(enemySpherePos, enemySphereSize, Color.Gray);
|
||||
DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, Color.DarkGray);
|
||||
|
||||
// Draw player
|
||||
DrawCubeV(playerPosition, playerSize, playerColor);
|
||||
@ -127,7 +127,7 @@ public class BoxCollisions
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("Move player with cursors to collide", 220, 40, 20, Color.GRAY);
|
||||
DrawText("Move player with cursors to collide", 220, 40, 20, Color.Gray);
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
|
@ -31,7 +31,7 @@ public class CubicmapDemo
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
Image image = LoadImage("resources/cubicmap.png");
|
||||
Texture2D cubicmap = LoadTextureFromImage(image);
|
||||
@ -43,7 +43,7 @@ public class CubicmapDemo
|
||||
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
|
||||
|
||||
// Set map diffuse texture
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
Vector3 mapPosition = new(-16.0f, 0.0f, -8.0f);
|
||||
UnloadImage(image);
|
||||
@ -56,32 +56,32 @@ public class CubicmapDemo
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
|
||||
UpdateCamera(ref camera, CameraMode.Orbital);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawModel(model, mapPosition, 1.0f, Color.WHITE);
|
||||
DrawModel(model, mapPosition, 1.0f, Color.White);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
Vector2 position = new(screenWidth - cubicmap.Width * 4 - 20, 20);
|
||||
DrawTextureEx(cubicmap, position, 0.0f, 4.0f, Color.WHITE);
|
||||
DrawTextureEx(cubicmap, position, 0.0f, 4.0f, Color.White);
|
||||
DrawRectangleLines(
|
||||
screenWidth - cubicmap.Width * 4 - 20,
|
||||
20,
|
||||
cubicmap.Width * 4,
|
||||
cubicmap.Height * 4,
|
||||
Color.GREEN
|
||||
Color.Green
|
||||
);
|
||||
|
||||
DrawText("cubicmap image used to", 658, 90, 10, Color.GRAY);
|
||||
DrawText("generate map 3d model", 658, 104, 10, Color.GRAY);
|
||||
DrawText("cubicmap image used to", 658, 90, 10, Color.Gray);
|
||||
DrawText("generate map 3d model", 658, 104, 10, Color.Gray);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class FirstPersonMaze
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
Image imMap = LoadImage("resources/cubicmap.png");
|
||||
Texture2D cubicmap = LoadTextureFromImage(imMap);
|
||||
@ -42,7 +42,7 @@ public class FirstPersonMaze
|
||||
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
|
||||
|
||||
// Set map diffuse texture
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
// Get map image data to be used for collision detection
|
||||
Color* mapPixels = LoadImageColors(imMap);
|
||||
@ -61,7 +61,7 @@ public class FirstPersonMaze
|
||||
//----------------------------------------------------------------------------------
|
||||
Vector3 oldCamPos = camera.Position;
|
||||
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
|
||||
UpdateCamera(ref camera, CameraMode.FirstPerson);
|
||||
|
||||
// Check player collision (we simplify to 2D collision detection)
|
||||
Vector2 playerPos = new(camera.Position.X, camera.Position.Z);
|
||||
@ -120,18 +120,18 @@ public class FirstPersonMaze
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
// Draw maze map
|
||||
BeginMode3D(camera);
|
||||
DrawModel(model, mapPosition, 1.0f, Color.WHITE);
|
||||
DrawModel(model, mapPosition, 1.0f, Color.White);
|
||||
EndMode3D();
|
||||
|
||||
DrawTextureEx(cubicmap, new Vector2(GetScreenWidth() - cubicmap.Width * 4 - 20, 20), 0.0f, 4.0f, Color.WHITE);
|
||||
DrawRectangleLines(GetScreenWidth() - cubicmap.Width * 4 - 20, 20, cubicmap.Width * 4, cubicmap.Height * 4, Color.GREEN);
|
||||
DrawTextureEx(cubicmap, new Vector2(GetScreenWidth() - cubicmap.Width * 4 - 20, 20), 0.0f, 4.0f, Color.White);
|
||||
DrawRectangleLines(GetScreenWidth() - cubicmap.Width * 4 - 20, 20, cubicmap.Width * 4, cubicmap.Height * 4, Color.Green);
|
||||
|
||||
// Draw player position radar
|
||||
DrawRectangle(GetScreenWidth() - cubicmap.Width * 4 - 20 + playerCellX * 4, 20 + playerCellY * 4, 4, 4, Color.RED);
|
||||
DrawRectangle(GetScreenWidth() - cubicmap.Width * 4 - 20 + playerCellX * 4, 20 + playerCellY * 4, 4, 4, Color.Red);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class GeometricShapes
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -47,23 +47,23 @@ public class GeometricShapes
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.RED);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.GOLD);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.MAROON);
|
||||
DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Red);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Gold);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.Maroon);
|
||||
|
||||
DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.GREEN);
|
||||
DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.LIME);
|
||||
DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.Green);
|
||||
DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.Lime);
|
||||
|
||||
DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SKYBLUE);
|
||||
DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DARKBLUE);
|
||||
DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.BROWN);
|
||||
DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SkyBlue);
|
||||
DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DarkBlue);
|
||||
DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.Brown);
|
||||
|
||||
DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.GOLD);
|
||||
DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.PINK);
|
||||
DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Gold);
|
||||
DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Pink);
|
||||
|
||||
DrawGrid(10, 1.0f);
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class HeightmapDemo
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
Image image = LoadImage("resources/heightmap.png");
|
||||
Texture2D texture = LoadTextureFromImage(image);
|
||||
@ -40,7 +40,7 @@ public class HeightmapDemo
|
||||
Model model = LoadModelFromMesh(mesh);
|
||||
|
||||
// Set map diffuse texture
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
Vector3 mapPosition = new(-8.0f, 0.0f, -8.0f);
|
||||
|
||||
@ -54,24 +54,24 @@ public class HeightmapDemo
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
|
||||
UpdateCamera(ref camera, CameraMode.Orbital);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawModel(model, mapPosition, 1.0f, Color.RED);
|
||||
DrawModel(model, mapPosition, 1.0f, Color.Red);
|
||||
|
||||
DrawGrid(20, 1.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawTexture(texture, screenWidth - texture.Width - 20, 20, Color.WHITE);
|
||||
DrawRectangleLines(screenWidth - texture.Width - 20, 20, texture.Width, texture.Height, Color.GREEN);
|
||||
DrawTexture(texture, screenWidth - texture.Width - 20, 20, Color.White);
|
||||
DrawRectangleLines(screenWidth - texture.Width - 20, 20, texture.Width, texture.Height, Color.Green);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class MeshDemo
|
||||
camera.Target = Vector3.Zero;
|
||||
camera.Up = Vector3.UnitY;
|
||||
camera.FovY = 60.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Generate a mesh using utils to allocate/access mesh attribute data
|
||||
Mesh tetrahedron = new(4, 4);
|
||||
@ -44,10 +44,10 @@ public class MeshDemo
|
||||
texcoords[2] = Vector2.UnitY;
|
||||
texcoords[3] = Vector2.One;
|
||||
|
||||
colors[0] = Color.PINK;
|
||||
colors[1] = Color.LIME;
|
||||
colors[2] = Color.SKYBLUE;
|
||||
colors[3] = Color.VIOLET;
|
||||
colors[0] = Color.Pink;
|
||||
colors[1] = Color.Lime;
|
||||
colors[2] = Color.SkyBlue;
|
||||
colors[3] = Color.Violet;
|
||||
|
||||
indices[0] = 2;
|
||||
indices[1] = 1;
|
||||
@ -76,7 +76,7 @@ public class MeshDemo
|
||||
Texture2D texture = Raylib.LoadTextureFromImage(image);
|
||||
Raylib.UnloadImage(image);
|
||||
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_DIFFUSE, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Diffuse, ref texture);
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -86,17 +86,17 @@ public class MeshDemo
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
|
||||
UpdateCamera(ref camera, CameraMode.Free);
|
||||
rotationAngle = Raymath.Wrap(rotationAngle += 1f, 0f, 360f);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
Raylib.DrawModelEx(model, Vector3.Zero, Vector3.UnitX, rotationAngle, Vector3.One, Color.WHITE);
|
||||
Raylib.DrawModelEx(model, Vector3.Zero, Vector3.UnitX, rotationAngle, Vector3.One, Color.White);
|
||||
EndMode3D();
|
||||
|
||||
EndDrawing();
|
||||
|
@ -26,7 +26,7 @@ public class MeshGeneration
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - mesh generation");
|
||||
|
||||
// We generate a isChecked image for texturing
|
||||
Image isChecked = GenImageChecked(2, 2, 1, 1, Color.RED, Color.GREEN);
|
||||
Image isChecked = GenImageChecked(2, 2, 1, 1, Color.Red, Color.Green);
|
||||
Texture2D texture = LoadTextureFromImage(isChecked);
|
||||
UnloadImage(isChecked);
|
||||
|
||||
@ -46,7 +46,7 @@ public class MeshGeneration
|
||||
for (int i = 0; i < models.Length; i++)
|
||||
{
|
||||
// Set map diffuse texture
|
||||
Raylib.SetMaterialTexture(ref models[i], 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref models[i], 0, MaterialMapIndex.Albedo, ref texture);
|
||||
}
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
@ -55,7 +55,7 @@ public class MeshGeneration
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Model drawing position
|
||||
Vector3 position = new(0.0f, 0.0f, 0.0f);
|
||||
@ -70,9 +70,9 @@ public class MeshGeneration
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
|
||||
UpdateCamera(ref camera, CameraMode.Orbital);
|
||||
|
||||
if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
|
||||
if (IsMouseButtonPressed(MouseButton.Left))
|
||||
{
|
||||
// Cycle between the textures
|
||||
currentModel = (currentModel + 1) % models.Length;
|
||||
@ -82,48 +82,48 @@ public class MeshGeneration
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawModel(models[currentModel], position, 1.0f, Color.WHITE);
|
||||
DrawModel(models[currentModel], position, 1.0f, Color.White);
|
||||
|
||||
DrawGrid(10, 1.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawRectangle(30, 400, 310, 30, ColorAlpha(Color.SKYBLUE, 0.5f));
|
||||
DrawRectangleLines(30, 400, 310, 30, ColorAlpha(Color.DARKBLUE, 0.5f));
|
||||
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, Color.BLUE);
|
||||
DrawRectangle(30, 400, 310, 30, ColorAlpha(Color.SkyBlue, 0.5f));
|
||||
DrawRectangleLines(30, 400, 310, 30, ColorAlpha(Color.DarkBlue, 0.5f));
|
||||
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, Color.Blue);
|
||||
|
||||
switch (currentModel)
|
||||
{
|
||||
case 0:
|
||||
DrawText("PLANE", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("PLANE", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 1:
|
||||
DrawText("CUBE", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("CUBE", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 2:
|
||||
DrawText("SPHERE", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("SPHERE", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 3:
|
||||
DrawText("HEMISPHERE", 640, 10, 20, Color.DARKBLUE);
|
||||
DrawText("HEMISPHERE", 640, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 4:
|
||||
DrawText("CYLINDER", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("CYLINDER", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 5:
|
||||
DrawText("TORUS", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("TORUS", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 6:
|
||||
DrawText("KNOT", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("KNOT", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 7:
|
||||
DrawText("POLY", 680, 10, 20, Color.DARKBLUE);
|
||||
DrawText("POLY", 680, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
case 8:
|
||||
DrawText("Custom (triagnle)", 580, 10, 20, Color.DARKBLUE);
|
||||
DrawText("Custom (triagnle)", 580, 10, 20, Color.DarkBlue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -33,14 +33,14 @@ public class MeshPicking
|
||||
camera.Target = new Vector3(0.0f, 8.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.6f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Picking ray
|
||||
Ray ray = new();
|
||||
|
||||
Model tower = LoadModel("resources/models/obj/turret.obj");
|
||||
Texture2D texture = LoadTexture("resources/models/obj/turret_diffuse.png");
|
||||
Raylib.SetMaterialTexture(ref tower, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref tower, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
Vector3 towerPos = new(0.0f, 0.0f, 0.0f);
|
||||
BoundingBox towerBBox = GetMeshBoundingBox(tower.Meshes[0]);
|
||||
@ -75,11 +75,11 @@ public class MeshPicking
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsCursorHidden())
|
||||
{
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
|
||||
UpdateCamera(ref camera, CameraMode.FirstPerson);
|
||||
}
|
||||
|
||||
// Toggle camera controls
|
||||
if (IsMouseButtonPressed(MouseButton.MOUSE_BUTTON_RIGHT))
|
||||
if (IsMouseButtonPressed(MouseButton.Right))
|
||||
{
|
||||
if (IsCursorHidden())
|
||||
{
|
||||
@ -96,7 +96,7 @@ public class MeshPicking
|
||||
string hitObjectName = "None";
|
||||
collision.Distance = float.MaxValue;
|
||||
collision.Hit = false;
|
||||
Color cursorColor = Color.WHITE;
|
||||
Color cursorColor = Color.White;
|
||||
|
||||
// Get ray and test against objects
|
||||
ray = GetMouseRay(GetMousePosition(), camera);
|
||||
@ -106,7 +106,7 @@ public class MeshPicking
|
||||
if (groundHitInfo.Hit && (groundHitInfo.Distance < collision.Distance))
|
||||
{
|
||||
collision = groundHitInfo;
|
||||
cursorColor = Color.GREEN;
|
||||
cursorColor = Color.Green;
|
||||
hitObjectName = "Ground";
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public class MeshPicking
|
||||
if (triHitInfo.Hit && (triHitInfo.Distance < collision.Distance))
|
||||
{
|
||||
collision = triHitInfo;
|
||||
cursorColor = Color.PURPLE;
|
||||
cursorColor = Color.Purple;
|
||||
hitObjectName = "Triangle";
|
||||
|
||||
bary = Vector3Barycenter(collision.Point, ta, tb, tc);
|
||||
@ -126,7 +126,7 @@ public class MeshPicking
|
||||
if ((sphereHitInfo.Hit) && (sphereHitInfo.Distance < collision.Distance))
|
||||
{
|
||||
collision = sphereHitInfo;
|
||||
cursorColor = Color.ORANGE;
|
||||
cursorColor = Color.Orange;
|
||||
hitObjectName = "Sphere";
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ public class MeshPicking
|
||||
if (boxHitInfo.Hit && boxHitInfo.Distance < collision.Distance)
|
||||
{
|
||||
collision = boxHitInfo;
|
||||
cursorColor = Color.ORANGE;
|
||||
cursorColor = Color.Orange;
|
||||
hitObjectName = "Box";
|
||||
|
||||
// Check ray collision against model meshes
|
||||
@ -160,7 +160,7 @@ public class MeshPicking
|
||||
if (meshHitInfo.Hit)
|
||||
{
|
||||
collision = meshHitInfo;
|
||||
cursorColor = Color.ORANGE;
|
||||
cursorColor = Color.Orange;
|
||||
hitObjectName = "Mesh";
|
||||
}
|
||||
}
|
||||
@ -169,65 +169,65 @@ public class MeshPicking
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
// Draw the tower
|
||||
DrawModel(tower, towerPos, 1.0f, Color.WHITE);
|
||||
DrawModel(tower, towerPos, 1.0f, Color.White);
|
||||
|
||||
// Draw the test triangle
|
||||
DrawLine3D(ta, tb, Color.PURPLE);
|
||||
DrawLine3D(tb, tc, Color.PURPLE);
|
||||
DrawLine3D(tc, ta, Color.PURPLE);
|
||||
DrawLine3D(ta, tb, Color.Purple);
|
||||
DrawLine3D(tb, tc, Color.Purple);
|
||||
DrawLine3D(tc, ta, Color.Purple);
|
||||
|
||||
// Draw the test sphere
|
||||
DrawSphereWires(sp, sr, 8, 8, Color.PURPLE);
|
||||
DrawSphereWires(sp, sr, 8, 8, Color.Purple);
|
||||
|
||||
// Draw the mesh bbox if we hit it
|
||||
if (boxHitInfo.Hit)
|
||||
{
|
||||
DrawBoundingBox(towerBBox, Color.LIME);
|
||||
DrawBoundingBox(towerBBox, Color.Lime);
|
||||
}
|
||||
|
||||
// If we hit something, draw the cursor at the hit point
|
||||
if (collision.Hit)
|
||||
{
|
||||
DrawCube(collision.Point, 0.3f, 0.3f, 0.3f, cursorColor);
|
||||
DrawCubeWires(collision.Point, 0.3f, 0.3f, 0.3f, Color.RED);
|
||||
DrawCubeWires(collision.Point, 0.3f, 0.3f, 0.3f, Color.Red);
|
||||
|
||||
Vector3 normalEnd = collision.Point + collision.Normal;
|
||||
DrawLine3D(collision.Point, normalEnd, Color.RED);
|
||||
DrawLine3D(collision.Point, normalEnd, Color.Red);
|
||||
}
|
||||
|
||||
DrawRay(ray, Color.MAROON);
|
||||
DrawRay(ray, Color.Maroon);
|
||||
|
||||
DrawGrid(10, 10.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
// Draw some debug GUI text
|
||||
DrawText($"Hit Object: {hitObjectName}", 10, 50, 10, Color.BLACK);
|
||||
DrawText($"Hit Object: {hitObjectName}", 10, 50, 10, Color.Black);
|
||||
|
||||
if (collision.Hit)
|
||||
{
|
||||
int ypos = 70;
|
||||
|
||||
DrawText($"Distance: {collision.Distance}", 10, ypos, 10, Color.BLACK);
|
||||
DrawText($"Distance: {collision.Distance}", 10, ypos, 10, Color.Black);
|
||||
|
||||
DrawText($"Hit Pos: {collision.Point}", 10, ypos + 15, 10, Color.BLACK);
|
||||
DrawText($"Hit Pos: {collision.Point}", 10, ypos + 15, 10, Color.Black);
|
||||
|
||||
DrawText($"Hit Norm: {collision.Normal}", 10, ypos + 30, 10, Color.BLACK);
|
||||
DrawText($"Hit Norm: {collision.Normal}", 10, ypos + 30, 10, Color.Black);
|
||||
|
||||
if (triHitInfo.Hit)
|
||||
{
|
||||
DrawText($"Barycenter: {bary}", 10, ypos + 45, 10, Color.BLACK);
|
||||
DrawText($"Barycenter: {bary}", 10, ypos + 45, 10, Color.Black);
|
||||
}
|
||||
}
|
||||
|
||||
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, Color.GRAY);
|
||||
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, Color.Gray);
|
||||
|
||||
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
|
||||
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class ModelCubeTexture
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Load texture to be applied to the cubes sides
|
||||
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
|
||||
@ -51,12 +51,12 @@ public class ModelCubeTexture
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
// Draw cube with an applied texture
|
||||
DrawCubeTexture(texture, new Vector3(-2.0f, 2.0f, 0.0f), 2.0f, 4.0f, 2.0f, Color.WHITE);
|
||||
DrawCubeTexture(texture, new Vector3(-2.0f, 2.0f, 0.0f), 2.0f, 4.0f, 2.0f, Color.White);
|
||||
|
||||
// Draw cube with an applied texture, but only a defined rectangle piece of the texture
|
||||
DrawCubeTextureRec(
|
||||
@ -66,7 +66,7 @@ public class ModelCubeTexture
|
||||
2.0f,
|
||||
2.0f,
|
||||
2.0f,
|
||||
Color.WHITE
|
||||
Color.White
|
||||
);
|
||||
|
||||
DrawGrid(10, 1.0f);
|
||||
@ -113,7 +113,7 @@ public class ModelCubeTexture
|
||||
// Rlgl.Rotatef(45, 0, 1, 0);
|
||||
// Rlgl.Scalef(2.0f, 2.0f, 2.0f);
|
||||
|
||||
Rlgl.Begin(DrawMode.QUADS);
|
||||
Rlgl.Begin(DrawMode.Quads);
|
||||
Rlgl.Color4ub(color.R, color.G, color.B, color.A);
|
||||
|
||||
// Front Face
|
||||
@ -239,7 +239,7 @@ public class ModelCubeTexture
|
||||
|
||||
// We calculate the normalized texture coordinates for the desired texture-source-rectangle
|
||||
// It means converting from (tex.Width, tex.Height) coordinates to [0.0f, 1.0f] equivalent
|
||||
Rlgl.Begin(DrawMode.QUADS);
|
||||
Rlgl.Begin(DrawMode.Quads);
|
||||
Rlgl.Color4ub(color.R, color.G, color.B, color.A);
|
||||
|
||||
// Front face
|
||||
|
@ -40,13 +40,13 @@ public class ModelLoading
|
||||
camera.Target = new Vector3(0.0f, 10.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
Model model = LoadModel("resources/models/obj/castle.obj");
|
||||
Texture2D texture = LoadTexture("resources/models/obj/castle_diffuse.png");
|
||||
|
||||
// Set map diffuse texture
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
Vector3 position = new(0.0f, 0.0f, 0.0f);
|
||||
BoundingBox bounds = GetMeshBoundingBox(model.Meshes[0]);
|
||||
@ -64,7 +64,7 @@ public class ModelLoading
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
|
||||
UpdateCamera(ref camera, CameraMode.Free);
|
||||
|
||||
if (IsFileDropped())
|
||||
{
|
||||
@ -81,7 +81,7 @@ public class ModelLoading
|
||||
model = LoadModel(files[0]);
|
||||
|
||||
// Set current map diffuse texture
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
|
||||
bounds = GetMeshBoundingBox(model.Meshes[0]);
|
||||
|
||||
@ -92,13 +92,13 @@ public class ModelLoading
|
||||
// Unload model texture and load new one
|
||||
UnloadTexture(texture);
|
||||
texture = LoadTexture(files[0]);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
|
||||
Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Select model on mouse click
|
||||
if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
|
||||
if (IsMouseButtonPressed(MouseButton.Left))
|
||||
{
|
||||
// Check collision between ray and box
|
||||
if (GetRayCollisionBox(GetMouseRay(GetMousePosition(), camera), bounds).Hit)
|
||||
@ -115,28 +115,28 @@ public class ModelLoading
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawModel(model, position, 1.0f, Color.WHITE);
|
||||
DrawModel(model, position, 1.0f, Color.White);
|
||||
|
||||
DrawGrid(20, 10.0f);
|
||||
|
||||
if (selected)
|
||||
{
|
||||
DrawBoundingBox(bounds, Color.GREEN);
|
||||
DrawBoundingBox(bounds, Color.Green);
|
||||
}
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("Drag & drop model to load mesh/texture.", 10, GetScreenHeight() - 20, 10, Color.DARKGRAY);
|
||||
DrawText("Drag & drop model to load mesh/texture.", 10, GetScreenHeight() - 20, 10, Color.DarkGray);
|
||||
if (selected)
|
||||
{
|
||||
DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, Color.GREEN);
|
||||
DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, Color.Green);
|
||||
}
|
||||
|
||||
DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
|
||||
DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class OrthographicProjection
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = FOVY_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -46,17 +46,17 @@ public class OrthographicProjection
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed(KeyboardKey.KEY_SPACE))
|
||||
if (IsKeyPressed(KeyboardKey.Space))
|
||||
{
|
||||
if (camera.Projection == CameraProjection.CAMERA_PERSPECTIVE)
|
||||
if (camera.Projection == CameraProjection.Perspective)
|
||||
{
|
||||
camera.FovY = WIDTH_ORTHOGRAPHIC;
|
||||
camera.Projection = CameraProjection.CAMERA_ORTHOGRAPHIC;
|
||||
camera.Projection = CameraProjection.Orthographic;
|
||||
}
|
||||
else
|
||||
{
|
||||
camera.FovY = FOVY_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -64,37 +64,37 @@ public class OrthographicProjection
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.RED);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.GOLD);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.MAROON);
|
||||
DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Red);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Gold);
|
||||
DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.Maroon);
|
||||
|
||||
DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.GREEN);
|
||||
DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.LIME);
|
||||
DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.Green);
|
||||
DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.Lime);
|
||||
|
||||
DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SKYBLUE);
|
||||
DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DARKBLUE);
|
||||
DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.BROWN);
|
||||
DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SkyBlue);
|
||||
DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DarkBlue);
|
||||
DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.Brown);
|
||||
|
||||
DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.GOLD);
|
||||
DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.PINK);
|
||||
DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Gold);
|
||||
DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Pink);
|
||||
|
||||
DrawGrid(10, 1.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, Color.DARKGRAY);
|
||||
DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, Color.DarkGray);
|
||||
|
||||
if (camera.Projection == CameraProjection.CAMERA_ORTHOGRAPHIC)
|
||||
if (camera.Projection == CameraProjection.Orthographic)
|
||||
{
|
||||
DrawText("ORTHOGRAPHIC", 10, 40, 20, Color.BLACK);
|
||||
DrawText("ORTHOGRAPHIC", 10, 40, 20, Color.Black);
|
||||
}
|
||||
else if (camera.Projection == CameraProjection.CAMERA_PERSPECTIVE)
|
||||
else if (camera.Projection == CameraProjection.Perspective)
|
||||
{
|
||||
DrawText("PERSPECTIVE", 10, 40, 20, Color.BLACK);
|
||||
DrawText("PERSPECTIVE", 10, 40, 20, Color.Black);
|
||||
}
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
@ -31,7 +31,7 @@ public class SkyboxDemo
|
||||
camera.Target = new Vector3(4.0f, 1.0f, 4.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Load skybox model
|
||||
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
|
||||
@ -46,22 +46,22 @@ public class SkyboxDemo
|
||||
Raylib.SetShaderValue(
|
||||
shdrSkybox,
|
||||
GetShaderLocation(shdrSkybox, "environmentMap"),
|
||||
(int)MaterialMapIndex.MATERIAL_MAP_CUBEMAP,
|
||||
ShaderUniformDataType.SHADER_UNIFORM_INT
|
||||
(int)MaterialMapIndex.Cubemap,
|
||||
ShaderUniformDataType.Int
|
||||
);
|
||||
|
||||
Raylib.SetShaderValue(
|
||||
shdrSkybox,
|
||||
GetShaderLocation(shdrSkybox, "doGamma"),
|
||||
useHdr ? 1 : 0,
|
||||
ShaderUniformDataType.SHADER_UNIFORM_INT
|
||||
ShaderUniformDataType.Int
|
||||
);
|
||||
|
||||
Raylib.SetShaderValue(
|
||||
shdrSkybox,
|
||||
GetShaderLocation(shdrSkybox, "vflipped"),
|
||||
useHdr ? 1 : 0,
|
||||
ShaderUniformDataType.SHADER_UNIFORM_INT
|
||||
ShaderUniformDataType.Int
|
||||
);
|
||||
|
||||
Raylib.SetMaterialShader(ref skybox, 0, ref shdrSkybox);
|
||||
@ -75,7 +75,7 @@ public class SkyboxDemo
|
||||
shdrCubemap,
|
||||
GetShaderLocation(shdrCubemap, "equirectangularMap"),
|
||||
0,
|
||||
ShaderUniformDataType.SHADER_UNIFORM_INT
|
||||
ShaderUniformDataType.Int
|
||||
);
|
||||
|
||||
// Load skybox
|
||||
@ -90,16 +90,16 @@ public class SkyboxDemo
|
||||
shdrCubemap,
|
||||
panorama,
|
||||
1024,
|
||||
PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
|
||||
PixelFormat.UncompressedR8G8B8A8
|
||||
);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
|
||||
UnloadTexture(panorama);
|
||||
}
|
||||
else
|
||||
{
|
||||
Image img = LoadImage("resources/skybox.png");
|
||||
Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.CUBEMAP_LAYOUT_AUTO_DETECT);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
|
||||
Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.AutoDetect);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
|
||||
UnloadImage(img);
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ public class SkyboxDemo
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
|
||||
UpdateCamera(ref camera, CameraMode.FirstPerson);
|
||||
|
||||
// Load new cubemap texture on drag & drop
|
||||
if (IsFileDropped())
|
||||
@ -125,7 +125,7 @@ public class SkyboxDemo
|
||||
if (IsFileExtension(files[0], ".png;.jpg;.hdr;.bmp;.tga"))
|
||||
{
|
||||
// Unload cubemap texture and load new one
|
||||
UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP));
|
||||
UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap));
|
||||
|
||||
if (useHdr)
|
||||
{
|
||||
@ -134,16 +134,16 @@ public class SkyboxDemo
|
||||
shdrCubemap,
|
||||
panorama,
|
||||
1024,
|
||||
PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
|
||||
PixelFormat.UncompressedR8G8B8A8
|
||||
);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
|
||||
UnloadTexture(panorama);
|
||||
}
|
||||
else
|
||||
{
|
||||
Image img = LoadImage(files[0]);
|
||||
Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.CUBEMAP_LAYOUT_AUTO_DETECT);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
|
||||
Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.AutoDetect);
|
||||
SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
|
||||
UnloadImage(img);
|
||||
}
|
||||
|
||||
@ -156,14 +156,14 @@ public class SkyboxDemo
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
// We are inside the cube, we need to disable backface culling!
|
||||
Rlgl.DisableBackfaceCulling();
|
||||
Rlgl.DisableDepthMask();
|
||||
DrawModel(skybox, Vector3.Zero, 1.0f, Color.WHITE);
|
||||
DrawModel(skybox, Vector3.Zero, 1.0f, Color.White);
|
||||
Rlgl.EnableBackfaceCulling();
|
||||
Rlgl.EnableDepthMask();
|
||||
|
||||
@ -178,12 +178,12 @@ public class SkyboxDemo
|
||||
10,
|
||||
GetScreenHeight() - 20,
|
||||
10,
|
||||
Color.BLACK
|
||||
Color.Black
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawText($": {skyboxFileName}", 10, GetScreenHeight() - 20, 10, Color.BLACK);
|
||||
DrawText($": {skyboxFileName}", 10, GetScreenHeight() - 20, 10, Color.Black);
|
||||
}
|
||||
|
||||
DrawFPS(10, 10);
|
||||
@ -195,7 +195,7 @@ public class SkyboxDemo
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadShader(Raylib.GetMaterial(ref skybox, 0).Shader);
|
||||
UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP));
|
||||
UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap));
|
||||
|
||||
UnloadModel(skybox);
|
||||
|
||||
@ -222,15 +222,15 @@ public class SkyboxDemo
|
||||
Rlgl.FramebufferAttach(
|
||||
fbo,
|
||||
rbo,
|
||||
FramebufferAttachType.RL_ATTACHMENT_DEPTH,
|
||||
FramebufferAttachTextureType.RL_ATTACHMENT_RENDERBUFFER,
|
||||
FramebufferAttachType.Depth,
|
||||
FramebufferAttachTextureType.Renderbuffer,
|
||||
0
|
||||
);
|
||||
Rlgl.FramebufferAttach(
|
||||
fbo,
|
||||
cubemap.Id,
|
||||
FramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0,
|
||||
FramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_X,
|
||||
FramebufferAttachType.ColorChannel0,
|
||||
FramebufferAttachTextureType.CubemapPositiveX,
|
||||
0
|
||||
);
|
||||
|
||||
@ -253,7 +253,7 @@ public class SkyboxDemo
|
||||
Rlgl.CULL_DISTANCE_NEAR,
|
||||
Rlgl.CULL_DISTANCE_FAR
|
||||
);
|
||||
Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_PROJECTION], matFboProjection);
|
||||
Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.MatrixProjection], matFboProjection);
|
||||
|
||||
// Define view matrix for every side of the cubemap
|
||||
Matrix4x4[] fboViews = new[]
|
||||
@ -276,15 +276,15 @@ public class SkyboxDemo
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
// Set the view matrix for the current cube face
|
||||
Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_VIEW], fboViews[i]);
|
||||
Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.MatrixView], fboViews[i]);
|
||||
|
||||
// Select the current cubemap face attachment for the fbo
|
||||
// WARNING: This function by default enables->attach->disables fbo!!!
|
||||
Rlgl.FramebufferAttach(
|
||||
fbo,
|
||||
cubemap.Id,
|
||||
FramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0,
|
||||
FramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i,
|
||||
FramebufferAttachType.ColorChannel0,
|
||||
FramebufferAttachTextureType.CubemapPositiveX + i,
|
||||
0
|
||||
);
|
||||
Rlgl.EnableFramebuffer(fbo);
|
||||
|
@ -40,7 +40,7 @@ public class SolarSystem
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 45.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// General system rotation speed
|
||||
float rotationSpeed = 0.2f;
|
||||
@ -61,7 +61,7 @@ public class SolarSystem
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
|
||||
UpdateCamera(ref camera, CameraMode.Free);
|
||||
|
||||
earthRotation += (5.0f * rotationSpeed);
|
||||
earthOrbitRotation += (365 / 360.0f * (5.0f * rotationSpeed) * rotationSpeed);
|
||||
@ -72,7 +72,7 @@ public class SolarSystem
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
@ -80,7 +80,7 @@ public class SolarSystem
|
||||
// Scale Sun
|
||||
Rlgl.Scalef(sunRadius, sunRadius, sunRadius);
|
||||
// Draw the Sun
|
||||
DrawSphereBasic(Color.GOLD);
|
||||
DrawSphereBasic(Color.Gold);
|
||||
Rlgl.PopMatrix();
|
||||
|
||||
Rlgl.PushMatrix();
|
||||
@ -98,7 +98,7 @@ public class SolarSystem
|
||||
Rlgl.Scalef(earthRadius, earthRadius, earthRadius);
|
||||
|
||||
// Draw the Earth
|
||||
DrawSphereBasic(Color.BLUE);
|
||||
DrawSphereBasic(Color.Blue);
|
||||
Rlgl.PopMatrix();
|
||||
|
||||
// Rotation for Moon orbit around Earth
|
||||
@ -113,7 +113,7 @@ public class SolarSystem
|
||||
Rlgl.Scalef(moonRadius, moonRadius, moonRadius);
|
||||
|
||||
// Draw the Moon
|
||||
DrawSphereBasic(Color.LIGHTGRAY);
|
||||
DrawSphereBasic(Color.LightGray);
|
||||
Rlgl.PopMatrix();
|
||||
|
||||
// Some reference elements (not affected by previous matrix transformations)
|
||||
@ -122,13 +122,13 @@ public class SolarSystem
|
||||
earthOrbitRadius,
|
||||
new Vector3(1, 0, 0),
|
||||
90.0f,
|
||||
ColorAlpha(Color.RED, 0.5f)
|
||||
ColorAlpha(Color.Red, 0.5f)
|
||||
);
|
||||
DrawGrid(20, 1.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, Color.MAROON);
|
||||
DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, Color.Maroon);
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
@ -150,7 +150,7 @@ public class SolarSystem
|
||||
int rings = 16;
|
||||
int slices = 16;
|
||||
|
||||
Rlgl.Begin(DrawMode.TRIANGLES);
|
||||
Rlgl.Begin(DrawMode.Triangles);
|
||||
Rlgl.Color4ub(color.R, color.G, color.B, color.A);
|
||||
|
||||
for (int i = 0; i < (rings + 2); i++)
|
||||
|
@ -34,7 +34,7 @@ public class WavingCubes
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 70.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Specify the amount of blocks in each direction
|
||||
const int numBlocks = 15;
|
||||
@ -61,7 +61,7 @@ public class WavingCubes
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
|
@ -33,12 +33,12 @@ public class YawPitchRoll
|
||||
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
|
||||
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
|
||||
camera.FovY = 30.0f;
|
||||
camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
|
||||
camera.Projection = CameraProjection.Perspective;
|
||||
|
||||
// Model loading
|
||||
Model model = LoadModel("resources/models/obj/plane.obj");
|
||||
Texture2D texture = LoadTexture("resources/models/obj/plane_diffuse.png");
|
||||
model.Materials[0].Maps[(int)MaterialMapIndex.MATERIAL_MAP_DIFFUSE].Texture = texture;
|
||||
model.Materials[0].Maps[(int)MaterialMapIndex.Diffuse].Texture = texture;
|
||||
|
||||
float pitch = 0.0f;
|
||||
float roll = 0.0f;
|
||||
@ -53,11 +53,11 @@ public class YawPitchRoll
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Plane roll (x-axis) controls
|
||||
if (IsKeyDown(KeyboardKey.KEY_DOWN))
|
||||
if (IsKeyDown(KeyboardKey.Down))
|
||||
{
|
||||
pitch += 0.6f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_UP))
|
||||
else if (IsKeyDown(KeyboardKey.Up))
|
||||
{
|
||||
pitch -= 0.6f;
|
||||
}
|
||||
@ -74,11 +74,11 @@ public class YawPitchRoll
|
||||
}
|
||||
|
||||
// Plane yaw (y-axis) controls
|
||||
if (IsKeyDown(KeyboardKey.KEY_S))
|
||||
if (IsKeyDown(KeyboardKey.S))
|
||||
{
|
||||
yaw += 1.0f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_A))
|
||||
else if (IsKeyDown(KeyboardKey.A))
|
||||
{
|
||||
yaw -= 1.0f;
|
||||
}
|
||||
@ -95,11 +95,11 @@ public class YawPitchRoll
|
||||
}
|
||||
|
||||
// Plane pitch (z-axis) controls
|
||||
if (IsKeyDown(KeyboardKey.KEY_LEFT))
|
||||
if (IsKeyDown(KeyboardKey.Left))
|
||||
{
|
||||
roll += 1.0f;
|
||||
}
|
||||
else if (IsKeyDown(KeyboardKey.KEY_RIGHT))
|
||||
else if (IsKeyDown(KeyboardKey.Right))
|
||||
{
|
||||
roll -= 1.0f;
|
||||
}
|
||||
@ -122,30 +122,30 @@ public class YawPitchRoll
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(Color.RAYWHITE);
|
||||
ClearBackground(Color.RayWhite);
|
||||
|
||||
// Draw 3D model (recomended to draw 3D always before 2D)
|
||||
BeginMode3D(camera);
|
||||
|
||||
// Draw 3d model with texture
|
||||
DrawModel(model, new Vector3(0.0f, -8.0f, 0.0f), 1.0f, Color.WHITE);
|
||||
DrawModel(model, new Vector3(0.0f, -8.0f, 0.0f), 1.0f, Color.White);
|
||||
DrawGrid(10, 10.0f);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
// Draw controls info
|
||||
DrawRectangle(30, 370, 260, 70, Fade(Color.GREEN, 0.5f));
|
||||
DrawRectangleLines(30, 370, 260, 70, Fade(Color.DARKGREEN, 0.5f));
|
||||
DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 380, 10, Color.DARKGRAY);
|
||||
DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 400, 10, Color.DARKGRAY);
|
||||
DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 420, 10, Color.DARKGRAY);
|
||||
DrawRectangle(30, 370, 260, 70, Fade(Color.Green, 0.5f));
|
||||
DrawRectangleLines(30, 370, 260, 70, Fade(Color.DarkGreen, 0.5f));
|
||||
DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 380, 10, Color.DarkGray);
|
||||
DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 400, 10, Color.DarkGray);
|
||||
DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 420, 10, Color.DarkGray);
|
||||
|
||||
DrawText(
|
||||
"(c) WWI Plane Model created by GiaHanLam",
|
||||
screenWidth - 240,
|
||||
screenHeight - 20,
|
||||
10,
|
||||
Color.DARKGRAY
|
||||
Color.DarkGray
|
||||
);
|
||||
|
||||
EndDrawing();
|
||||
|
Reference in New Issue
Block a user