OpenTK.3D.Library 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OpenTK.3D.Library --version 1.2.0
                    
NuGet\Install-Package OpenTK.3D.Library -Version 1.2.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="OpenTK.3D.Library" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenTK.3D.Library" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="OpenTK.3D.Library" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenTK.3D.Library --version 1.2.0
                    
#r "nuget: OpenTK.3D.Library, 1.2.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.
#:package OpenTK.3D.Library@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenTK.3D.Library&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=OpenTK.3D.Library&version=1.2.0
                    
Install as a Cake Tool

OpenTK3DEngine

Example code:

  1. Add a new .cs line to your console app, that will be your main place to code
  2. On your program.cs file add the example code no. 2,
  3. If you dont want the console opening change your project properties to Windows Application
using System;
using OpenTK;
using OpenTK.Graphics;
using Program;

namespace yourNameSpace
{
    public class yourClass : MainRenderWindow
    {
        public yourClass(int width, int height, string title)
            : base(width, height, title)
        {
        }

        protected override void OnLoad(EventArgs e)
        {
            setClearColor(new Color4(0.0f, 0.0f, 0.0f, 1.0f)); //Sets Background Color
            UseDepthTest = false; //Enables Depth Testing for 3D
            RenderLight = false; //Makes the 3D light visible
            UseAlpha = true; //Enables alpha use
            KeyboardAndMouseInput = false; //Enables keyboard and mouse input for 3D movement
            base.OnLoad(e);
        }

        protected override void OnRenderFrame(FrameEventArgs e)
        {
            Clear();

            drawEllipse(500, 500, 10f, 10f, new Color4(1.0f, 1.0f, 1.0f, 1.0f)); //Draws a circle

            base.OnRenderFrame(e);

        }

        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            base.OnUpdateFrame(e);
        }
    }
}
namespace yourNamespace
{
    static class Program
    {
        static void Main(string[] args)
        {
            using youClass game = new youClass(1000, 1000, "Test App");
            //Run takes a double, which is how many frames per second it should strive to reach.
            //You can leave that out and it'll just update as fast as the hardware will allow it.
            game.Run(60.0);
        }
    }
}

Current Available Functions

On OnLoad
  1. Make sure to add these after base.OnLoad()

  2. createMainLight(Vector3 pos, Vector3 color) ⇒ Creates your main Light (static), make sure to run this function before any other 3D function but after Base.OnLoad(),

  3. createCube(Vector3 Color) ⇒ Creates a 3D cube of the color you specify, returns a handle for making modifications to the cube,

  4. createSphere(Vector3 Color) ⇒ Creates a 3D sphere of the color you specify, returns a handle for making modifications to the sphere,

  5. createTorus(Vector3 Color) ⇒ Creates a 3D torus of the color you specify, returns a handle for making modifications to the torus,

  6. createCylinder(Vector3 Color) ⇒ Creates a 3D cylinder of the color you specify, returns a handle for making modifications to the cylinder,

  7. public int createPlane(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, Vector3 color) ⇒ Creates a 3D plane of the color you specify, returns a handle for making modifications to the plane,

  8. openTexturedObj(string obj, string texture) ⇒ Opens .obj file with an attached .png texture, returns a handle for making modifications to the object,

  9. openObj(string obj, Vector3 color) ⇒ Opens .obj file with no attached .png texture, returns a handle for making modifications to the object,

On OnRenderFrame
  1. 3D Functions:

    1. rotateObject(float x, float y, float z, int handle),
    2. rotateTexturedObject(float x, float y, float z, int handle),
    3. scaleObject(float scale, int handle),
    4. translateObject(float x, float y, float z, int handle),
    5. translateTexturedObject(float x, float y, float z, int handle),
  2. 2D Functions:

    1. drawRectangle(float x1, float y1, float x2, float y2, Color4 color),
    2. drawLine(float x1, float y1, float x2, float y2, Color4 color),
    3. drawEllipse(float x, float y, float radiusX, float radiusY, Color4 color),
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.  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. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.4.0 1,439 12/8/2020
2.3.0 608 12/8/2020
2.2.0 627 12/7/2020
2.1.0 587 12/7/2020
2.0.1 640 11/6/2020
2.0.0 661 11/4/2020
1.8.5 677 11/2/2020
1.8.4 640 11/2/2020
1.8.3 666 11/2/2020
1.8.2 680 11/1/2020
1.8.1 638 11/1/2020
1.8.0 591 11/1/2020
1.7.6 582 11/1/2020
1.7.5 584 11/1/2020
1.7.4 700 10/31/2020
1.7.3 636 10/28/2020
1.7.2 675 10/28/2020
1.7.1 674 10/27/2020
1.7.0 634 10/25/2020
1.2.0 787 10/18/2020
Loading failed