OpenTK.3D.Library
1.2.0
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
<PackageReference Include="OpenTK.3D.Library" Version="1.2.0" />
<PackageVersion Include="OpenTK.3D.Library" Version="1.2.0" />
<PackageReference Include="OpenTK.3D.Library" />
paket add OpenTK.3D.Library --version 1.2.0
#r "nuget: OpenTK.3D.Library, 1.2.0"
#addin nuget:?package=OpenTK.3D.Library&version=1.2.0
#tool nuget:?package=OpenTK.3D.Library&version=1.2.0
OpenTK3DEngine
Example code:
- Add a new .cs line to your console app, that will be your main place to code
- On your program.cs file add the example code no. 2,
- 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
Make sure to add these after base.OnLoad()
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(),
createCube(Vector3 Color) ⇒ Creates a 3D cube of the color you specify, returns a handle for making modifications to the cube,
createSphere(Vector3 Color) ⇒ Creates a 3D sphere of the color you specify, returns a handle for making modifications to the sphere,
createTorus(Vector3 Color) ⇒ Creates a 3D torus of the color you specify, returns a handle for making modifications to the torus,
createCylinder(Vector3 Color) ⇒ Creates a 3D cylinder of the color you specify, returns a handle for making modifications to the cylinder,
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,
openTexturedObj(string obj, string texture) ⇒ Opens .obj file with an attached .png texture, returns a handle for making modifications to the object,
openObj(string obj, Vector3 color) ⇒ Opens .obj file with no attached .png texture, returns a handle for making modifications to the object,
On OnRenderFrame
3D Functions:
- rotateObject(float x, float y, float z, int handle),
- rotateTexturedObject(float x, float y, float z, int handle),
- scaleObject(float scale, int handle),
- translateObject(float x, float y, float z, int handle),
- translateTexturedObject(float x, float y, float z, int handle),
2D Functions:
- drawRectangle(float x1, float y1, float x2, float y2, Color4 color),
- drawLine(float x1, float y1, float x2, float y2, Color4 color),
- drawEllipse(float x, float y, float radiusX, float radiusY, Color4 color),
Product | Versions 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. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
-
.NETCoreApp 2.1
- Microsoft.Win32.SystemEvents (>= 4.7.0)
- OpenTK (>= 3.2.0)
- SixLabors.ImageSharp (>= 1.0.1)
- System.Drawing.Common (>= 4.7.0)
-
.NETCoreApp 3.1
- Microsoft.Win32.SystemEvents (>= 4.7.0)
- OpenTK (>= 3.2.0)
- SixLabors.ImageSharp (>= 1.0.1)
- System.Drawing.Common (>= 4.7.0)
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,147 | 12/8/2020 |
2.3.0 | 426 | 12/8/2020 |
2.2.0 | 431 | 12/7/2020 |
2.1.0 | 410 | 12/7/2020 |
2.0.1 | 462 | 11/6/2020 |
2.0.0 | 476 | 11/4/2020 |
1.8.5 | 504 | 11/2/2020 |
1.8.4 | 468 | 11/2/2020 |
1.8.3 | 477 | 11/2/2020 |
1.8.2 | 520 | 11/1/2020 |
1.8.1 | 486 | 11/1/2020 |
1.8.0 | 410 | 11/1/2020 |
1.7.6 | 407 | 11/1/2020 |
1.7.5 | 399 | 11/1/2020 |
1.7.4 | 551 | 10/31/2020 |
1.7.3 | 462 | 10/28/2020 |
1.7.2 | 492 | 10/28/2020 |
1.7.1 | 525 | 10/27/2020 |
1.7.0 | 460 | 10/25/2020 |
1.6.6 | 453 | 10/24/2020 |
1.6.5 | 462 | 10/24/2020 |
1.6.4 | 463 | 10/24/2020 |
1.6.3 | 449 | 10/24/2020 |
1.6.2 | 510 | 10/23/2020 |
1.6.1 | 506 | 10/23/2020 |
1.6.0 | 506 | 10/23/2020 |
1.5.0 | 421 | 10/22/2020 |
1.4.9 | 457 | 10/22/2020 |
1.4.8 | 453 | 10/22/2020 |
1.4.7 | 464 | 10/22/2020 |
1.4.6 | 400 | 10/22/2020 |
1.4.5 | 428 | 10/22/2020 |
1.4.4 | 454 | 10/21/2020 |
1.4.3 | 443 | 10/21/2020 |
1.4.2 | 424 | 10/21/2020 |
1.4.1 | 433 | 10/21/2020 |
1.4.0 | 448 | 10/21/2020 |
1.3.4.3 | 451 | 10/21/2020 |
1.3.4.2 | 455 | 10/21/2020 |
1.3.4.1 | 481 | 10/21/2020 |
1.3.4 | 469 | 10/21/2020 |
1.3.3 | 439 | 10/21/2020 |
1.3.2.5 | 457 | 10/21/2020 |
1.3.2.4 | 470 | 10/21/2020 |
1.3.2.3 | 455 | 10/21/2020 |
1.3.2.2 | 433 | 10/21/2020 |
1.3.2.1 | 459 | 10/21/2020 |
1.3.2 | 471 | 10/21/2020 |
1.3.1 | 460 | 10/21/2020 |
1.3.0 | 428 | 10/21/2020 |
1.2.0 | 597 | 10/18/2020 |
1.1.0 | 417 | 10/18/2020 |
1.0.0 | 460 | 10/18/2020 |