R3d.Net
0.1.2
dotnet add package R3d.Net --version 0.1.2
NuGet\Install-Package R3d.Net -Version 0.1.2
<PackageReference Include="R3d.Net" Version="0.1.2" />
<PackageVersion Include="R3d.Net" Version="0.1.2" />
<PackageReference Include="R3d.Net" />
paket add R3d.Net --version 0.1.2
#r "nuget: R3d.Net, 0.1.2"
#:package R3d.Net@0.1.2
#addin nuget:?package=R3d.Net&version=0.1.2
#tool nuget:?package=R3d.Net&version=0.1.2
R3d.Net
C# bindings for R3D, advanced 3D rendering library for raylib
R3d.Net targets net8.0 and uses the R3D 0.3 or later to build the native libraries. Raylib-cs 7.0.1 is used as nuget dependency.
R3d.Net is heavily inspired by raylib-cs and uses some of its functionality to implement bindings.
Status
Currently in active development, available API is subject to change.
Installation - NuGet
You can add package to the project with this command:
dotnet add package R3d.Net
Installation - Manual
Download/clone the repo
Add R3d.Net/R3d.Net.csproj to your project as an existing project.
Download/clone the original R3D repo with all dependencies.
Build R3D's native dependencies and place them in the same directory as the executable. Required files:
r3d.dll
andassimp.dll
orassimp-vc143-mt.dll
.You should now be able to use R3d.Net in your projects.
Basic R3D example in R3d.Net
using R3d.Net.Types;
using Raylib_cs;
using System.Numerics;
namespace R3d.Net.Examples
{
internal class Program
{
static void Main(string[] args)
{
// Initialize raylib window
Raylib.InitWindow(800, 600, "R3D Example");
// Initialize R3D Renderer with default settings
R3d.Init(800, 600, 0);
// Load a model to render
// 'true' indicates that we upload immediately to the GPU
var mesh = R3d.GenMeshSphere(1.0f, 16, 32, true);
// Get a material with default values
var material = R3d.GetDefaultMaterial();
// Create a directional light
// NOTE: The direction will be normalized
var light = R3d.CreateLight(LightType.Directional);
R3d.SetLightDirection(light, new Vector3(-1, -1, -1));
R3d.SetLightActive(light, true);
// Init a Camera3D
var camera = new Camera3D
{
Position = new Vector3(-3, 3, 3),
Target = Vector3.Zero,
Up = Vector3.UnitY,
FovY = 60.0f,
Projection = CameraProjection.Perspective
};
// Main rendering loop
while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();
R3d.Begin(camera);
R3d.DrawMesh(ref mesh, ref material, Raymath.MatrixIdentity());
R3d.End();
Raylib.EndDrawing();
}
// Close R3D renderer and raylib
R3d.UnloadMesh(ref mesh);
R3d.Close();
Raylib.CloseWindow();
}
}
}
Other examples can be found in the R3d.Net.Examples folder. All examples were ported from the original R3D library.
Contributing
The library still requires a lot of improvements and may contain some issues.
Feel free to open an issue or submit a pull request.
License
Licenced under the Zlib License.
See LICENSE for details.
Acknowledgements
A huge thanks to the original raylib, r3d and raylib-cs developers for their enormous contributions to our raylib community.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Raylib-cs (>= 7.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.