Monday 2 November 2009

This weekend's output

Hallo again.

Since this whole 3D rendering malarky is about getting up to scratch on the various conventional wisdoms of 3D graphics and programming in general, I decided to try and implement a few other fairly commonly used features into my little engine.

  • Terrain generator! It uses perlin noise to create a square patch of terrain, and then averages out all the vertex Y values to make it much smoother.
  • Per-triangle terrain collision! As my small running robot fella travels across the world a point at his feet is checked against the triangle he is currently above (or below, but he's generally above things). The exact height of his (X,Z) position on the triangle is calculated using bilinear interpolation, and if he's below it, he's snapped to the surface.
  • 3rd Person Camera! At the moment it only follows and rotates with the robot, however adding rotation around the X axis, like in a third person shooter, is on the todo list, along with camera-terrain collision.
  • Erm, class structure? Looking through unreal script I really liked the way that there are two separate classes for which can be combined to make an entity in the world. They are the controller and the Pawn. Once defines the actual 3D object with its functions and animations, and the other defines how it is controlled. I have made an attempt to implement a similar structure here. The Entity class contains a Model, a Controller, and a PhysicalObject. Which all feed eachother information through standard functions whenever the entity is updated, and which are all updated separately, by graphics, control, and physics managers.

Here is video:


As you can see there is still a fair bit of optimizing which needs to take place, also the collision can be a little sketchy at times. Also, clip planes in action!

Next thing to do is definitely back-face culling since I needs the speed. 

Following weekend is going to be consumed by unreal script/level making,  expect more in two weeks! 

Right now Kenji-san and I are about to embark on an all-night XNA project (deadline 10am), I'll post our creation when I have time.


Byeeee



No comments:

Post a Comment