SaM3d! - Test programs




Camera example

Description

This is a very small example that shows how to create several viewports for an application and how to use different cameras. It displays a scene (a bunch of colored cubes) seen from 2 cameras in 2 viewports.

Using this demo

To use this demo, just run the camera binary.

Here are the useful controls:

  • e : move forward.
  • x : move backward.
  • s : move left.
  • d : move right.
  • r : move up.
  • c : move down.
  • spacebar : change controllable camera.
  • F1 : previous display mode.
  • F2 : next display mode.
  • F11 : show/hide console.
  • F12 : screen capture.
  • use the mouse to rotate the camera.


Quake 3 map renderer

Description

This is a very basic Quake 3 BSP renderer.

Download

You will find a Win32/Linux compiled version in the download section of NeHe's site

Using this demo

To run this program, you will need .pk3 files from Quake 3 Arena or Return to Castle Wolfenstein. You can also grab an archive that contains the 4 maps of the Quake 3 Arena demo here (from the cake homepage).

Before running the demo, you will have to edit the config.lua file. This is where you will specify the path to the pk3 files and the name of the map you wish to view. A typical config.lua file looks like this:

-- [[ Quake 3 Arena, demo version
-- The pak0.zip file must be in the same directory as q3view.exe
pak_path="pak0.zip" -- the path to the pak files.
map_name="q3dm1" -- the name of the map.
--]]

A few tips about the config file (it is a Lua file):

  • Comments start with --. Block comments are enclosed between --[[ and ]].
  • You can define intermediate variable and use the .. operator to concatenate strings.

To use this demo, just run the q3view binary.

Here are the useful controls:

  • e : move forward.
  • x : move backward.
  • s : move left.
  • d : move right.
  • r : move up.
  • c : move down.
  • j : decrease gamma correction.
  • k : increase gamma correction.
  • o : toggle frustum culling.
  • p : toggle PVS.
  • w : toggle wireframe mode.
  • F1 : previous display mode.
  • F2 : next display mode.
  • F11 : show/hide console.
  • F12 : screen capture.
  • use the mouse to rotate the camera.

Features

  • polygons, meshes, bezier patches ;
  • texture, lightmaps and basic shader support ;
  • sky : skyboxes and cloudbox ;
  • BSP, PVS, frustum culling ;
  • zip compressed files.

Missing features, future works

  • billboards ;
  • entities ;
  • fog ;
  • vertex deformations ;
  • ...


Quake 2 animated model renderer

Description

I found a really nice tutorial about MD2 models here and decided to write an MD2 loader and animated models for SaM3d!. It uses (nearly) the same data structures as the Q3A BSP viewer.

The Astro Boy model was created by Jonn Gorden.

Using this demo

To use this demo, just run the md2view binary.

Here are the useful controls:

  • e : move forward.
  • x : move backward.
  • s : move left.
  • d : move right.
  • r : move up.
  • c : move down.
  • SPACE BAR : change model animation.
  • F1 : previous display mode.
  • F2 : next display mode.
  • F12 : screen capture.
  • l : change lighting mode (no lighting, OpenGL lighting, celshading).
  • p : change light type (point light, directional light).
  • o : change light motion (rotating, no motion).
  • page up, page down : move light up, down.
  • use the mouse to rotate the camera.


Astro Boy with celshading
An old version (no lighting yet)