PDA

View Full Version : Kek flag in open gl



stonedunicorn
12-14-2017, 10:41 AM
Hi i am really a newbie in opengl i have made some objects and other stuff but i cant complete this flag. The hearts at the top left seem to be impossible and its had to overlay all the lines maybe someone can do it and type the code so i can see how
Thanks!

2570

didydriver
12-14-2017, 02:54 PM
I'm not even sure what that flag is. If you are doing it by code vs texture then take up trig because it's going to be an adventure. Bruce Eckels didn't name his book "Thinking in C++" for nothing.

silikone
12-26-2017, 01:51 PM
Might want to simplify it to make it feasible with vertices. Use a grid drawing tool and translate the coordinates to OpenGL.
So what are you making? A game for ethnic Kekistanis?

dorbie
12-28-2017, 05:40 AM
Your approach is wrong. You should load this image as a texture and then apply the texture to a mesh of triangles if you want a flag. Then you can animate the mesh with a wave pattern or other dynamic simulation and it will correctly deform the texture pattern you have applied to the mesh. There are plenty of examples out there on how to do this.

http://nehe.gamedev.net/tutorial/flag_effect_(waving_texture)/16002/
http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Chapter-4:-Rendering-a-Dynamic-3D-Scene-with-Phong-Shading.html