Showing posts with label basic tutorial. Show all posts
Showing posts with label basic tutorial. Show all posts

Tuesday, April 14, 2015

OpenTK Tutorial 7: Simple Objects from OBJ files

This tutorial is going to be rather short. What we'll do is add a new class that can open very simple OBJ files and add some sample models to the project.


Wednesday, February 25, 2015

OpenTK Tutorial 6 Project File now on GitHub

Missed having OpenTK content? Good news, I'm working on making more of it soon! Up next is a demo on using orthographic projection with what we've covered in previous tutorials to make sprites (as requested by an anonymous commenter a while back).

While you all wait for that, the basic textures tutorial project is now up on GitHub:

https://github.com/neokabuto/OpenTKTutorialContent/tree/master/OpenTKTutorial6


Monday, October 13, 2014

SFML Tutorial: Hello World

In this tutorial, we'll create a SFML window and draw a shape and some text, and demonstrate a basic animation.

This tutorial assumes that you already have the SFML.Net libraries and their dependencies, but we will create a new project file for this tutorial. This and all future tutorials will assume that you are using Visual Studio (however, it's definitely possible to use SFML.Net with Mono!).

A portion of the code used in this tutorial (and likely future tutorials) is taken from the official examples for SFML.Net.

Friday, October 10, 2014

Setting up SFML.Net

SMFL.Net is a binding of the Simple and Fast Multimedia Library that allows us to use its functions in C# and VB.Net. It's simple to use (hence the name) and portable (although my tutorials will only focus on Windows).

However, setting it up requires some extra work compared to some other libraries. The pre-built libraries available on the SFML website are not only a year old (so they're missing quite a few changes made since then), but the dependencies included probably won't work and one of the DLLs is MIA (technically it wasn't missing at the time, but now it's an important part of the library).

(I know things have been mostly OpenTK up until this point, but I needed a bit of a break. And if these SFML.Net tutorials go on long enough, they'll end up back in OpenTK territory, so don't worry!)

Sunday, July 13, 2014

OpenTK Tutorial 6 Part 3: Putting it all together

Now that we have TexturedCube, and a way to load shaders and textures, we can finally get to the good part, drawing some textured objects!

In this tutorial, we'll be wrapping up the texturing content. At the end, we'll have two cubes being rendered with different textures on them.

Wednesday, April 23, 2014

OpenTK Tutorial 6 Part 2: Loading Textures and the TexturedCube Class

Now that we have our shaders loaded in a new, more object-oriented way, we're a third of the way to having textured objects in our program!

In this tutorial, we'll add a function to send textures to the graphics card and write a new class to give us a cube with texture coordinates. Unfortunately, we'll need to wait for part 3 to put these to use, but I'll try to hurry it along (summer is almost here)!

Tuesday, March 11, 2014

OpenTK Tutorial 6 Part 1: Loading Shaders with a Class

This tutorial will cover basic texturing. To add a texture, we will first need to have a shader that handles it. Right now, we're using one shader, with no way to easily switch to another without requiring everything to use that shader. In a real game or program, we would probably want to be able to use multiple shaders (for example, UI elements probably don't need lighting applied to them, but game objects probably do), so we're going to handle this with a class that allows us to easily add more shaders if we need them, and switch between them at will.

This tutorial is split in parts, based on how long it is. Each step is rather substantial (and this groundwork will make things easier down the line), so I hope everyone understands why it needed to be split up like this.

Friday, January 10, 2014

OpenTK Tutorial 5: A Basic Camera

Now that we have many objects displayed, let's make a way to see them properly.

In this tutorial, we will be creating a simple camera with WASD controls and mouselook.

UPDATED 11-6-2018: New and improved input handling!


Friday, November 22, 2013

Open TK Tutorial 4 Addendum 2: The Sierpinski Tetrahedron, a Basic Fractal

Let's add a more complex shape to the program now. Cubes are nice, but unless we're making a Minecraft clone, they're not much to show off. In this example we'll have a class for making a Sierpinski Tetrahedron.

Friday, November 15, 2013

OpenTK Tutorial 4 Addendum: The ColorCube class

Here's a little class that can show drawing multiple objects better. It's a cube with a solid color (code after the break).



Friday, November 8, 2013

OpenTK Tutorial 4: It's amazing the way you DRAW TWO THINGS

In this tutorial, we'll build on our cube by making a second one. Along the way, we'll be remaking some of the old code to be more object-oriented to fit our future needs.

(I'd like to thank an anonymous commenter on the last tutorial for inspiring this one, since originally I was going to do texturing or a camera first)


Monday, July 22, 2013

OpenTK Tutorial 3 - Enter the Third Dimension

Now that we've draw one triangle the right way, let's add some real depth to our image. Here we'll be drawing a cube and rotating it so we can see our work from a different angle.

Friday, March 8, 2013

OpenTK Tutorial 2 - Drawing a Triangle... the Right Way!

The previous tutorial showed us how we can draw a triangle to the screen. However, it came with a disclaimer. Even though it works, it's not the "correct" way to do things anymore. The way we sent our geometry to the GPU was what's known as "immediate mode", which isn't the newest way to do things, even if it is so very nice and simple.

In this tutorial, we'll be going for the same end goal, but we'll be doing things in a way that is more complex, but at the same time more efficient, faster, and more expandable.


Saturday, February 16, 2013

OpenTK Tutorial 1 - Opening Windows and Drawing a Triangle

I'm writing this tutorial because the actual OpenTK documentation is sorely lacking. They have a good explanation for how to install it (which I recommend following before this, since it doesn't need to be rewritten), but that's it. There's a "Learn OpenTK in 15'" tutorial, but it's not great. You do make something simple, and it does take under 15 minutes, but they just hand you the code instead of having you create any of it. You don't learn much about what the code does, or why things are done a certain way. I'm going to try to write a better one (using mostly their code).

(As another note, this is technically using a deprecated way to do it, but I'm basing this on their example)