6 ms·
Where would a noob to this kind of stuff start? I'd like to draw a rectangle to the screen. :)
by missing_cipher 13y ago
Where would a noob to this kind of stuff start? I'd like to draw a rectangle to the screen. :)
- habith 13y agoI found NeHe's tutorials to be easy to follow especially since code that's ready to compile is provided at the end of each lesson: http://nehe.gamedev.net/ http://nehe.gamedev.net/ Most of them focus on OpenGL for windows. I just searched and found this WebGL tutorial which says it's based on NeHe's so it's hopefully good: http://learningwebgl.com/blog/?p=28 http://learningwebgl.com/blog/?p=28 Disclaimer: I'm not a game developer and I barely dabble in the 3D world, so take my links with a huge grain of salt :)
- Pxtl 13y agoMy understanding is that the NeHe tutorials are archaic and do not properly reflect modern OpenGL usage. Iirc the legacy constructs used in NeHe have been dropped in mobile implementations of OGL.
- exDM69 13y agoStay away from NeHe tutorials, they are badly written and really old. Pretty much everything they cover is deprecated and done in otherwise old fashioned ways. This is a big problem with OpenGL tutorials in general, a lot of them cover old stuff that shouldn't be used any more. The entire OpenGL fixed function pipeline is deprecated, replaced by programmable shader pipeline. It's a lot more work to get simple stuff done with shaders but it pays off in the end. If you're looking to write a game (and not an engine) it may be a good idea to get an engine and not write "raw" OpenGL at all.
- BlackDeath3 13y agoIf all you're looking to do is simple stuff (like get a rectangle on the screen), shaders are not required, correct?
- Narishma 13y agoThey are, unless you use old deprecated versions of OpenGL.
- BlackDeath3 13y agoSo the simplest program using the simplest shader would use a pass-through shader that doesn't modify the inputs?
- exDM69 13y agoYou do need shaders for pretty much everything. But if you only want to draw a rectangle with a solid color, you can do that using the scissor test and clearing "the screen". But that's about all you can do without shaders.
- dsego 13y agohttp://open.gl http://open.gl teaches the basics of using OpenGL to develop modern graphics applications.
- jaytheham 13y agohttp://www.arcsynthesis.org/gltut/ http://www.arcsynthesis.org/gltut/ That's an excellent resource for modern OpenGL, I have links for a few others at home that I can't recall off the top of my head.
- BHSPitMonkey 13y agoIf you're not feeling ready for 3D graphics, Khan Academy has a neat set of interactive lessons where you learn to draw and animate basic shapes using the HTML5 Canvas API (Javascript): https://www.khanacademy.org/cs/programming https://www.khanacademy.org/cs/programming
- petercooper 13y agohttp://pragprog.com/book/csjava/3d-game-programming-for-kids http://pragprog.com/book/csjava/3d-game-programming-for-kids (It's not literally just for kids.)
- Fr0styMatt 13y agoUdacity has a nice looking WebGL intro course: https://www.udacity.com/course/cs291 https://www.udacity.com/course/cs291
- copx 13y agoHere: Rectangle(100, 100, 400, 400) That or something very similar [1] draws a rectangle from pixel position (100,100) to (400,400) in many high level 2D graphics environments. Just posting this to point out that you do not have to make things more complicated than necessary. OpenGL is a standard for hardware accelerated 3D graphics and it is inherently complex because of that. If you just want to do 2D do not bother with it. [1] http://love2d.org/wiki/love.graphics.rectangle http://love2d.org/wiki/love.graphics.rectangle