background preloader

OpenGL

Facebook Twitter

OpenGL Video Tutorial - Terrain. Representing and Loading 3D Terrains One common feature in games and other 3D programs is the presence of a 3D terrain.

OpenGL Video Tutorial - Terrain

In this lesson, we will be making the following terrain: The question is, how do we represent a terrain? The most straightforward approach, and, as it turns out, one of the best approaches, is to make a 2D grid in the x-z plane and store the height of the terrain at each grid point. This doesn't let us make every terrain; for example, we can't have a purely vertical wall or a wall that is slanted "backwards". We could hard code every height into the program itself. There are some tools out there for making and manipulating heightmaps, although I'm not too familiar with them.

Going Through The Code Let's see how our program loads and displays the terrain. Class Terrain { private: int w; int l; float** hs; Vec3f** normals; bool computedNormals; Here's our terrain class. /src/org/anddev/andengine/opengl/texture/ - andengine - AndEngine - Free Android 2D OpenGL Game Engine. AndEngineWiki. Homebrew Coding: Android Native Coding in C. When I read questions like "How to do code sharing between Android and iOS" on stackoverflow.com, and the answers are variations on the theme: "the NDK is not for creating cross platform apps", it makes me sad.

Homebrew Coding: Android Native Coding in C

The NDK is an excellent way to write cross platform games. Here is a little insight into the approach I've taken with my so-far unreleased Chaos port. To code a game in C on Android you have to first write a Java Activity with a View. This can be either a regular View or one that is OpenGL-ified, this explanation uses the GLSurfaceView. Then you use the Java Native Interface (JNI) to call from Java into your C code. Using 2D OpenGL on Android (part 2) Game development - Android OpenGL ES and 2D. All about OpenGL ES 2.x – (part 3/3)(转载) - 大宝pku. Here we are for the final part of this serie of tutorial!

All about OpenGL ES 2.x – (part 3/3)(转载) - 大宝pku

Welcome back, my friends. Is time to dive in advanced knowledges about OpenGL and 3D world. In this tutorial we’ll see many things about the 2D graphics, multisampling, textures, render to off-screen surfaces and let’s try to optimize at maximum our applications’ performance. Is very important to you already know about all the concepts covered in the other 2 parts of this serie, if you miss something, here is a list: This serie is composed by 3 parts: At this time I imagine you know a lot of things about OpenGL and 3D world. As I’ve read once in a book: “One day you didn’t know to walk. Let’s start. Here is a little list of contents to orient your reading: At a glance Remembering everything until here: OpenGL’s logic is composed by just 3 simple concepts: Primitives, Buffers and Rasterize.OpenGL ES 2.x works with programmable pipeline, which is synonymous of Shaders.OpenGL isn’t aware of the output device, platform or output surface.

Android Development - Loading an OpenGL texture. If you search around on the Internet about how to load a texture for OpenGL ES on Android, then you will see quite a few people complaining how the supplied helper functions do not work.

Android Development - Loading an OpenGL texture

You will also find some fixes that work partially, but may not allow you to properly use the alpha channel. OpenGL ES Reference Manual. iPhone Development: OpenGL ES From the Ground Up, Part 6: Textures and Texture Mapping. An alternative to creating materials in OpenGL ES to define the color of a polygon is to map a texture onto that polygon.

iPhone Development: OpenGL ES From the Ground Up, Part 6: Textures and Texture Mapping

This is a handy options that can give you good looking objects while saving a lot of processor cycles. Say you wanted to create a brick wall in a game. You could, of course, create a complex object with thousands of vertices to define the shape of the individual bricks and the recessed lines of mortar between the bricks. Or you could create a single square out of two triangles (four vertices) and map a picture of a brick wall onto the square. Simple geometries with texture maps render much faster than complex geometries using materials.

Turning Things On. WebGL Lesson One: Getting Started. WebGL Lesson One.

WebGL Lesson One: Getting Started

This is the first tutorial for learning OpenGL ES 2 on the web, using WebGL. In this lesson, we’ll look at how to create a basic WebGL instance and display stuff to the screen, as well as what you need in order to view WebGL in your browser. There will also be an introduction to shaders and matrices. Android Lesson Four: Introducing Basic Texturing. Basic texturing.

Android Lesson Four: Introducing Basic Texturing

This is the fourth tutorial in our Android series. In this lesson, we’re going to add to what we learned in lesson three and learn how to add texturing.We’ll look at how to read an image from the application resources, load this image into OpenGL ES, and display it on the screen. Follow along with me and you’ll understand basic texturing in no time flat!

Assumptions and prerequisites Each lesson in this series builds on the lesson before it. The basics of texturing The art of texture mapping (along with lighting) is one of the most important parts of building up a realistic-looking 3D world. The first games to start heavily using textures, such as Doom and Duke Nukem 3D, were able to greatly enhance the realism of the gameplay through the added visual impact — these were games that could start to truly scare us if played at night in the dark. Here’s a look at a scene, without and with texturing: Texture coordinates In most computer images, the y axis is pointing downwards.