Archive for May, 2010
The concept of a camera in a Graphics application is simple. Just imagine that what you see is the view of the camera. So adjusting the camera lens or moving\rotating it should affect your view. In the base OpenGL library, there is no concept of a camera. However, it can be simulated by applying the [ READ MORE ]
This post demonstrates how to create a GLUT menu and add to it sub-menus and menu items. In the above sample app, clicking on a menu item in the popup menu will log that menu item’s ID to the console window. Below is the function setupMenus() that creates the main menu and adds to it [ READ MORE ]
If you come from a Java or C# perspective and want to create a multi-dimensional array in C or C++, you’ll soon figure out that multi-dimensional array allocation in C\C++ is not as simple, plus you’ll have to worry about deallocation since there is no garbage collector to do the work for you. Below I’ll [ READ MORE ]
I’ve been exploring\reading more about C pointers (mostly from this source) and I’ve found the following interesting tricks. Trick 1 – Pointer Arithmetics Question What is the result of running the following code? Solution ptr = arr This will make the pointer ptr point to the first element in the array arr. *ptr++ = -1 [ READ MORE ]
Using the GL_LINES mode, OpenGL will draw for us a line for every two vertices we specify. Behind the scenes, OpenGL is using interpolation to draw the line. That is, given 2 points, OpenGL will determine the set of pixels that the line would cross through and then change their color based on the color of the [ READ MORE ]
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 12 other followers
Get every new post delivered to your Inbox.