Modelling
From OpenCity
WARNING: this howto is neither complete nor exhaustive. Please contact us if you have any questions.
Contents |
How and Why
OpenCity display 3D models in real time. That's why, you should create light weight models only. We use AC3D because it is simple and easy to understand. You can use any other 3D modelling software if you want. The real objects pictures can give you some ideas for new 3D models.
- AC3D
- deviantart.com pixelart scenes, lots of good idea.
OpenCity's models' specifications
A model must meet some requirements in order to be rendered correctly by OpenCity. Each model must come with a ".conf" file which describes its internal properties. For example, you must specify the model's size in integer. In addition, the model has to be in the positive part of the 3D space (not centred on 0,0) (see relative position between axis and model). For more information concerning the ".conf" file, see "OpenCity_Design.sxw" in: docs/devel/
The model ground size must be integers, the Opencity unit it's the same as AC3D unit (bold grid). Minimum model size must be 1x1 (little house, ...), building, industrial warehouse, ... should be more large (3x3, 4x5, ...). Usually, we set level size to 0.3. A way to compute the height value for .conf file, is in AC3D "Edit > select all" and use ">" symbol on left side of "Size to" button on the left panel. All building models facing on growing Z axis (vehicle models are facing on 0 on Z axis). In order to use alpha-blending on model (PNG only) you need type "alpha=true" in "object data text" on object properties dialog (press F9 on selected object).
Model's weight
The models must be light weight, in order to do this, minimize its number of surfaces. You can control this with the F6 key in AC3D. A 1x1 model should have between 25 and 50 surfaces. More bigger is the model ground size (3x4, 5x7, ...), more surfacefull it can be. Don't keep bottom side of the box if isn't necessary, and use one-side surfaces as much as possible ("1S" button on left panel). bottom boxBottom view of box with the useful surfaces. An easy way to create light weight models is the "Gridsnap" drawing method (check box at the left bottom corner of the AC3D window), and the "Vertex > Snap to grid" menu function. After manipulation use the optimize option in "Object" menu: "Object > Optimize vertices" and "Object > Optimize surfaces". There is another way to reduce the surfaces number. You have to combine the surfaces (surfaces must be in the same object before, to merge object use "Object > Merge").
Texture
The texture file should be light weight, only one texture file is allowed by model. You can done texture less model, but if you use texture, all surfaces of your model must be bind on the texture. The texture's width and height size must be a power of 2 (128x64, 256x256, 64x512, ...) and minimum eidge side is 64 (OpenGL's limit), and it's forbiden (strongly discouraged) to create texture with eidge larger than 512. With AC3D trial version you can not use png or jpeg image files, but gif file only. You can use the "conv.perl" script from the "graphism/frodrigo/" module to replace the .gif references by .png or .jpeg in the .ac file.
Example
The station-p model in ac3d
Bottom view
Texture
Tips
Save vertices on wheels
Use flat whells on same texture as vehicle side. And set "alpha=true" on object properties.




