Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Entity API

codeThatThinks edited this page Feb 18, 2013 · 18 revisions

To be able to become powerful and wage war, it makes sense to be able to create infrastructure. Dominion inclues an API so you can easily accomplish this.

Currently, this API is mainly used for drawing buildings, though it can also be used to draw other stationary objects such as vehicles and topographical features. All you really need is a isometric image and some very basic Javascript skills.

Creating Isometric Graphics

For performance reasons, it's best to pre-render isometric imagery and load it into the game as an image. To accomplish this, we're going to be using Blender and Photoshop. You can also use your favorite 3D modeling or image editing software, though it's up to you to figure out how to set it up for isometric rendering.

Rendering in Blender

Firstly, you're going to need a model. To keep everything to scale, we're going to be using 1 inch = 1 foot. Here's a great tutorial on how to model things in Blender.

Once you're got your model, you're going to need to set up the camera. Select the camera and press N to bring up its properties. Under Rotation, change X to 54.736º, Y to 0º, and Z to 45º.

Camera Rotation

Next, click on the Camera tab of the right sidebar. Under Lens, select Orthographic, and change Orthographic Scale to 200.

Orthographic Projection

Under the Render tab, select PNG as the output format and set the color mode to RGBA. This will give the render a transparent background.

Render Settings

For lighting, it's up to you to determine how you want the scene to be lit. For the example entities, Ambient Occlusion was set to 1 and Environment Lighting was set to 0.2. Both options are under the World tab on that same sidebar.

World Lighting

Additionally, a plane can be placed under your model to produce a drop shadow around the base your model. Just make sure that the plane is transparent so it doesn't show up in the render.

Shadow Plane

Now you can F12 to render your entity.

Editing in Photoshop

Once you've saved the render, open it up in Photoshop so it can be resized and positioned properly.

Clone this wiki locally