CordellEngine 1.1.2

dotnet add package CordellEngine --version 1.1.2
NuGet\Install-Package CordellEngine -Version 1.1.2
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.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CordellEngine --version 1.1.2
#r "nuget: CordellEngine, 1.1.2"
#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.1.2

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

Cordell Engine

Simple library for implementing 3D graphics anywhere

UI based editor that working on rhis library u can see below this link https://github.com/j1sk1ss/CordellEditor.EXMPL

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")
      });

<h1 align="center"> Lightning </h1> <p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Seven.gif"> </p>


<h1 align="center"> Example of geometry in moving </h1> <p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Second.gif"> </p>


<h1 align="center"> 3D planing on scene </h1> <p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Fourth.gif"> </p>


<h1 align="center"> Color functionality </h1>

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;
}

<p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Third.gif"> </p>

Don`t foget to use COLOR CAMERA instead CHROME CAMERA


<h1 align="center"> Collisions, spawning and deleting </h1>

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:

<p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Fives.gif"> </p>


<h1 align="center"> Collections </h1>

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)));
  }

<p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Six.gif"> </p>


<h1 align="center"> Lines </h1>

But if u dont want to use preset objects like SPHERE or CUBE with PLANE, u can create ur own object with LINES united into COLLECTION. Next code will return next scene:

  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 Collection(new Vector3(0), new Vector3(1), new List<Object> {
                      new Line(new Vector3(-1.8, -1, 1), new Vector3(-1.8, 1, 1)),
                      new Line(new Vector3(-1.8, -1, 0), new Vector3(-1.8, 1, 0)),
                  
                      new Line(new Vector3(-1.8, -1, 0), new Vector3(-1.8, -1, -1)),
                      new Line(new Vector3(-1.8, -3, 0), new Vector3(-1.8, -3, -1)),
                  
                      new Line(new Vector3(0, -1, 1), new Vector3(0, 1, 1)),
                      new Line(new Vector3(0, -1, 0), new Vector3(0, 1, 0)),
                  
                      new Line(new Vector3(0, -1, 0), new Vector3(0, -1, -1)),
                      new Line(new Vector3(0, -3, 0), new Vector3(0, -3, -1)),
                  })
              });
  
          var t = 0;
          while (true) {
              t++;
              space.GetView();
              
              space.GetObject("collection1").SetPosition(new Vector3(Math.Cos(t * .01), -Math.Cos(t * .01), Math.Sin(t * .01)));
          }
  }

<p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Eight.gif"> </p>

  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 Collection(new Vector3(0, 0, 0), new Vector3(1), new List<Object> {
                      new Line(new Vector3(0,0,1), new Vector3(1,1,0)),
                      new Line(new Vector3(0,0,1), new Vector3(1,-1,0)),
                      new Line(new Vector3(0,0,1), new Vector3(-1,1,0)),
                      new Line(new Vector3(0,0,1), new Vector3(-1,-1,0)),
                      
                      new Line(new Vector3(1,1,2),  new Vector3(1,3,2)),
                      new Line(new Vector3(1,1,2),  new Vector3(3,1,2)),
                      new Line(new Vector3(-1,1,2),  new Vector3(-1,3,2)),
                      new Line(new Vector3(1,-1,2), new Vector3(3,-1,2)),
                  }),
              });
  
          var t = 0;
          while (true) {
              t++;
              space.GetView();
              
              space.GetObject("collection1").SetPosition(new Vector3(Math.Cos(t * .01), -Math.Cos(t * .01), Math.Sin(t * .01) + 1));
          }
      }

<p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Nine.gif"> </p>


<h1 align="center"> Polygons </h1>

U also can manualy work with POLYGONS. 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), 20), 
              new List<Object> {
                  new Collection(new Vector3(0), new Vector3(0), new List<Object> {
                      new Polygon(new [] {
                          new Vector3(0,-1,-1),
                          new Vector3(0,1,-1),
                          new Vector3(0,1,1),
                      }),
                      new Polygon(new [] {
                          new Vector3(0,-1,-1),
                          new Vector3(0,-1,1),
                          new Vector3(0,1,1),
                      }),
                      
                      new Polygon(new [] {
                          new Vector3(1,-1,-1),
                          new Vector3(0,-1,-1),
                          new Vector3(1,-1,1),
                      }),
                      new Polygon(new [] {
                          new Vector3(0,-1,-1),
                          new Vector3(0,-1,1),
                          new Vector3(6,-1,1),
                      }),
                  })
              });
  
          var t = 0;
          while (true) {
              t++;
              space.GetView();
              
              space.GetObject("collection1").Rotate(new Vector3(0, .01, .01));
          }
      }

Will return next scene:

<p align="center"> <img width="800" height="480" src="https://github.com/j1sk1ss/SharpEngine.EXMPL/blob/master/Ten.gif"> </p>

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 139 8/28/2023
1.1.1 140 8/27/2023
1.1.0 120 8/27/2023
1.0.0 147 8/17/2023