Monday, August 22, 2011

3D plaza with openGL and c#

This is an example of a 3D plaza, The waving flag was a code I borrowed from NEHE tutorials. The shadows are on the texture, they were rendered on 3D max studio. The sky-box and the grass outside are not models, they are hard coded. Collisions are implemented in the easiest way. That means that I am working on defining a 2D segment and calculating the distance to that segment, if that number is bellow a number I define there is a collision and therefore the camera wont move on that direction. Sources are in MVS 2008, I am using TAO Framework  and a small engine I made myself called Shadowengine.

Here is a list of what you will learn if you download(and leave a comment) this sample
  1. A small approach to simple camera collision
  2. You will learn how to implemente a simple FPS camera and to combine it with the collision class
  3. You will have the working code of a waving flag to use it to your convenience
  4. You will have a sky-box to use in your personal projects
  5. You will get an idea of what opengl Quadrics are, the stick of the flag is a quadric.
  6. If you wish you will learn how to use mi small opengl-engine, I develop this engine to teach my students the basis of 3D programming
Any comments on the blog will be useful, anonymous comments are enabled. Also I will answer all the questions about this project.
or try this


  1. Hi,
    Could you please tell me how to change the images of the buildings. When i tried to change the texture in 3d max design with other .jpg in visual studio the building was white without texture? Please help me.
    Thanks in advance.

  2. First of all, i tweak the texture loading a little bit, I made a 3d script to export my models with textures, the texture name should be the same that the mesh name and should be on the txtures folder, also they should be in jpg format.
    Write me back if you have any questions?

  3. Hi,
    I replaced "plaza14" from the texture folder with other jpg image with the same name ("plaza14"). In 3d max design from Material Editor I implemented this image as a bitmap for the polygon with name "plaza14". Is this correct? The new image is not visible in visual studio.

  4. Also is there a way to implement different images for the four of sides of the polygon? I want to create realistic buildings with images.

  5. Send me the image thats doesnt show correctly and I will check it

  6. Hi,
    Could you please upload Shadowengine source code that you used in this project ?