CordellEngine 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CordellEngine --version 1.0.0
NuGet\Install-Package CordellEngine -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CordellEngine" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CordellEngine --version 1.0.0
#r "nuget: CordellEngine, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CordellEngine as a Cake Addin
#addin nuget:?package=CordellEngine&version=1.0.0

// Install CordellEngine as a Cake Tool
#tool nuget:?package=CordellEngine&version=1.0.0

Cordell Engine

Simple library for implementing 3D graphics anywhere

Simple creation of objects

  var space = new Space(new ChromeCamera(new Vector3(-4,0,0), new Vector3(0)), 
      new List<Object> {
          new Sphere(new Vector3(0, 3, 0), new Vector3(1), Material.DefaultMaterial, "sphere_1"),
          new Sphere(new Vector3(0, -3, 0), new Vector3(1), Material.DefaultMaterial, "sphere_2"),
          new Light(new Vector3(-1, 0, -1), 1, "light1_1")
      });

Lighting

Alt Text


Example of geometry in moving

Alt Text


3D planing on scene

Alt Text


Color functionality

Every object ob scene have MATERIAL parametr with next constructors:

public Material(string gradient) {
    Gradient = gradient;
    ConsoleColor = ConsoleColor.White;
}

public Material(ConsoleColor color) {
    Gradient     = " .:!/r(l1Z4H9W8$@";
    ConsoleColor = color;
}

public Material(string gradient, ConsoleColor color) {
    Gradient     = gradient;
    ConsoleColor = color;
}

Alt Text

Don`t foget to use COLOR CAMERA instead CHROME CAMERA


Collisions, spawning and deleting

U also can SPAWN, DELETE and check COLLISIONS of objects in space. For example next code:

public static void Main() {
    Console.CursorVisible = false;

    var space = new Space(new ChromeCamera(new Vector3(-4,0,0), new Vector3(0)), 
        new List<Object> {
            new Sphere(new Vector3(0, 3, 0), new Vector3(1), Material.DefaultMaterial, "sphere_1"),
            new Sphere(new Vector3(0, -3, 0), new Vector3(1), Material.DefaultMaterial, "sphere_2"),
            new Light(new Vector3(-1, 0, -1), 1, "light1_1")
        });

    var t = 0;
    while (true) {
        t++;
        space.GetView();
        space.GetObject("new_sphere").SetPosition(new Vector3(Math.Sin(t * .01), 0, Math.Cos(t * .01)));
        
        
        space.GetObject("sphere_2").Move(new Vector3(0,.0010,0));
        if (space.GetObject("sphere_1").CollisionObjects(space.Objects).Count > 0)
        {
            space.DeleteObject("sphere_1");
            space.CreateObject(new Sphere(new Vector3(0), new Vector3(1), Material.DefaultMaterial, "new_sphere"));
        }
    }
}

Will return next scene:

Alt Text


Collections

U can unite objects into collections and work with them. First for this u should create collection and add some objects:

  var space = new Space(new ChromeCamera(new Vector3(-4,0,0), new Vector3(0)), 
        new List<Object> {
            new Collection(new Vector3(0), new Vector3(0), new List<Object> {
                new Sphere(new Vector3(0, 2, 0), new Vector3(1), Material.DefaultMaterial, "sphere_1"),   
                new Sphere(new Vector3(0, -2, 0), new Vector3(1), Material.DefaultMaterial, "sphere_2"),   
            }),
            new Light(new Vector3(-1, 0, -1), 1, "light_1")
  });

And next code will return next scene:

  var t = 0;
  while (true) {
        t++;
        space.GetView();

        space.GetObject("light_1").SetPosition(new Vector3(Math.Cos(t * .01), Math.Sin(t * .01),-1));
        space.GetObject("collection1").SetPosition(new Vector3(0, 0,Math.Sin(t * .01)));
  }

Alt Text

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 145 8/28/2023
1.1.1 143 8/27/2023
1.1.0 124 8/27/2023
1.0.0 152 8/17/2023