I can make a 3D triangle in Raylib, but now I want that triangle to have thickness.
How can this be accomplished with Raylib?
Here is code in C# that shows only one triangle with no thickness:
using System;
using Raylib_cs;
using System.Numerics;
namespace Triangle
{
class Program
{
static void Main(string[] args)
{
Raylib.InitWindow(800, 480, "Hello World");
Camera3D camera;
camera.position = new Vector3(10.0f, 10.0f, 10.0f); // Camera3D position
camera.target = new Vector3(0.0f, 0.0f, 0.0f); // Camera3D looking at point
camera.up = new Vector3(0.0f, 1.0f, 0.0f); // Camera3D up vector (rotation towards target)
camera.fovy = 120.0f; // Camera3D field-of-view Y
camera.type = CameraType.CAMERA_PERSPECTIVE; // Camera3D mode type
Vector3 point1 = new Vector3(0.0f, 0.0f, 0.0f);
Vector3 point2 = new Vector3(10.0f, 0.0f, 0.0f);
Vector3 point3 = new Vector3(10.0f, 10.0f, 0.0f);
Raylib.SetCameraMode(camera, CameraMode.CAMERA_FREE); // Set a free camera mode
Raylib.SetTargetFPS(60);
Rlgl.rlDisableBackfaceCulling();
while (!Raylib.WindowShouldClose())
{
Raylib.UpdateCamera(ref camera);
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.RAYWHITE);
Raylib.BeginMode3D(camera);
Raylib.DrawTriangle3D(point1, point2, point3, Color.BLACK);
Raylib.EndMode3D();
//text
Raylib.DrawRectangle(10, 10, 320, 133, Raylib.ColorAlpha(Color.SKYBLUE, 0.5f));
Raylib.DrawRectangleLines(10, 10, 320, 133, Color.BLUE);
Raylib.DrawText("Free camera default controls:", 20, 20, 10, Color.BLACK);
Raylib.DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, Color.DARKGRAY);
Raylib.DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, Color.DARKGRAY);
Raylib.DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, Color.DARKGRAY);
Raylib.DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, Color.DARKGRAY);
Raylib.EndDrawing();
}
Raylib.CloseWindow();
}
}
}
If anyone has some idea how this can be accomplished I would greatly appreciate it.