OpenGL and C# Tutorial | The OpenTK Library | Part -7 | Texture Mapping

  Рет қаралды 12,781

The Pentamollis Project

The Pentamollis Project

Күн бұрын

Пікірлер: 20
@logix8969
@logix8969 5 жыл бұрын
For anyone who wants it, here's my cube, complete with UVs: (Using clockwise winding) If you're interested in using backface culling, these would be the settings: GL.Enable(EnableCap.CullFace); GL.CullFace(CullFaceMode.Back); GL.FrontFace(FrontFaceDirection.Cw); // - Cube code float size = 10F; // FRONT GL.Normal3(0, 0, 1); GL.TexCoord2(0, 0); GL.Vertex3(-size, +size, +size); GL.TexCoord2(1, 0); GL.Vertex3(+size, +size, +size); GL.TexCoord2(1, 1); GL.Vertex3(+size, -size, +size); GL.TexCoord2(0, 1); GL.Vertex3(-size, -size, +size); // LEFT GL.Normal3(-1, 0, 0); GL.TexCoord2(0, 0); GL.Vertex3(-size, +size, -size); GL.TexCoord2(1, 0); GL.Vertex3(-size, +size, +size); GL.TexCoord2(1, 1); GL.Vertex3(-size, -size, +size); GL.TexCoord2(0, 1); GL.Vertex3(-size, -size, -size); // BACK GL.Normal3(0, 0, -1); GL.TexCoord2(0, 0); GL.Vertex3(+size, +size, -size); GL.TexCoord2(1, 0); GL.Vertex3(-size, +size, -size); GL.TexCoord2(1, 1); GL.Vertex3(-size, -size, -size); GL.TexCoord2(0, 1); GL.Vertex3(+size, -size, -size); // RIGHT GL.Normal3(1, 0, 0); GL.TexCoord2(0, 0); GL.Vertex3(+size, +size, +size); GL.TexCoord2(1, 0); GL.Vertex3(+size, +size, -size); GL.TexCoord2(1, 1); GL.Vertex3(+size, -size, -size); GL.TexCoord2(0, 1); GL.Vertex3(+size, -size, +size); // TOP GL.Normal3(0, 1, 0); GL.TexCoord2(0, 0); GL.Vertex3(-size, +size, -size); GL.TexCoord2(1, 0); GL.Vertex3(+size, +size, -size); GL.TexCoord2(1, 1); GL.Vertex3(+size, +size, +size); GL.TexCoord2(0, 1); GL.Vertex3(-size, +size, +size); // BOTTOM GL.Normal3(0, -1, 0); GL.TexCoord2(0, 0); GL.Vertex3(-size, -size, +size); GL.TexCoord2(1, 0); GL.Vertex3(+size, -size, +size); GL.TexCoord2(1, 1); GL.Vertex3(+size, -size, -size); GL.TexCoord2(0, 1); GL.Vertex3(-size, -size, -size);
@lordofkeyboards2066
@lordofkeyboards2066 3 жыл бұрын
HAHAHA I CAN NOW PUT NACHO TEXTURES ON THE GROUND YEAH! thanks for this tutorial :)
@aymericgoupil2138
@aymericgoupil2138 5 жыл бұрын
This is some fine tutorial, the explanations are clear. Thank you very much !
@artistmeme8103
@artistmeme8103 5 жыл бұрын
If I save the image within the project, can I set the directory starting from the Project file, and not the drive?
@thiagarajanv1143
@thiagarajanv1143 2 жыл бұрын
Thanks, nice explanation. Can you explain about zoom functions and Rotate function using mouse.. please.
@nolanvannoyofficial
@nolanvannoyofficial 4 жыл бұрын
can you link the code mine shows up as black and iv looked threw all your videos like 10 times
@chris_burrows
@chris_burrows 7 жыл бұрын
Nice man keep em coming!!
@seamusforever7081
@seamusforever7081 5 жыл бұрын
What if i want multiple textures?, how'd i specify what texture i'm setting the vertex coordinates to?
@seamusforever7081
@seamusforever7081 5 жыл бұрын
Btw, nice tutorial.
@andreibalasa745
@andreibalasa745 6 жыл бұрын
Need help please ! Gl.teximage2d(...) raises accesviolationexception
@_jeck_
@_jeck_ 6 жыл бұрын
Doesn't work for me. I can get polygons to load just fine, but not textures.
@eabarroso
@eabarroso 3 жыл бұрын
I'm trying to recreate the torch by looking at the json { "ambientocclusion": false, "textures": { "particle": "#torch" }, "elements": [ { "from": [ 7, 0, 7 ], "to": [ 9, 10, 9 ], "shade": false, "faces": { "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#torch" }, "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#torch" } } }, { "from": [ 7, 0, 0 ], "to": [ 9, 16, 16 ], "shade": false, "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" } } }, { "from": [ 0, 0, 7 ], "to": [ 16, 16, 9 ], "shade": false, "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" } } } ] }
@wbasterfield
@wbasterfield 6 жыл бұрын
Great stuff, but if I drag the game window onto a second monitor it stops rendering. How can we fix this ?
@samma-pixelstudio
@samma-pixelstudio 2 жыл бұрын
the second monitor is attached to you'r main GPU because if you are using another gpu and this gpu does not support openGl does not work the app
@ricardomunhoz6706
@ricardomunhoz6706 7 жыл бұрын
Very good , tks
@eabarroso
@eabarroso 3 жыл бұрын
Dude, how are you? I don't know if you can help me, but I'll try anyway. I have a png file, like the minecraft torch, however, I can't render it correctly, that is, get all the faces of the cube correctly aligned, can you help me?
@rafaeltab
@rafaeltab 4 жыл бұрын
using System.Drawing.Imaging;
@vmgpofc
@vmgpofc 5 жыл бұрын
Noice video!
OpenGL and C# Tutorial | The OpenTK Library | Part -8 | Keyboard Input
18:04
The Pentamollis Project
Рет қаралды 7 М.
Basic Texture Mapping // OpenGL Tutorial #16
22:01
OGLDEV
Рет қаралды 37 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
OpenTK Lecture | OpenGL Bindings For C#
1:34:09
NoNumberMan
Рет қаралды 12 М.
OpenGL and C# Tutorial | The OpenTK Library | Part - 10 | Approximating a Cone
20:40
OpenTK Basics Part 0: GameWindow and Setup
11:28
Sil Tutorials
Рет қаралды 24 М.
C# OpenGL Tutorial 6 : Texture Mapping
7:52
GiawaVideos
Рет қаралды 60 М.
KailashEngine 2 - Open Source - Graphics Demo - OpenGL/C#/OpenTK
6:58
Just enough assembly to blow your mind
29:31
Kay Lack
Рет қаралды 154 М.
2 Years Of Learning C | Prime Reacts
22:24
ThePrimeTime
Рет қаралды 319 М.
Modern OpenGL/C++ | How To Build A 3D Pyramid
9:24
The Coding Vault
Рет қаралды 17 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН