DF/Tutorial/6

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

6. Drawing THE Map

GOAL

Put the map into a model and draw the model, rather than random tiles.

Introduction

Map Model

Level Model

Tile Model

Translating Model to View

Plugging Model into View

Generating a Map

Moving Between Levels

Now we finally implement the camera motion that allows us to move up and down.

Animating the Transition

Human Interface note: Subtle animations can have a profound effect on human understanding.

When you go up, I want the level above to slide over the level we are at. This will suggest that the level we are going to sits above the level below it. When you go down, the level you are looking at should slide away to reveal the level below it.

Looking Through Levels

When you have an open square, you should be able to see hints at what lies below. I want to show up to 4 levels deep. Each level deeper will be subject to a fog effect. Thankfully, this is something that OpenGL does very well, provided we simply draw the lower levels at a different z index.

Volumetric lighting: Fog isn't always white or black or blue. It depends on what light is "inside" the volume you are looking through.