• Advertisement
Sign in to follow this  

creating a low poly modeling app

This topic is 3547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi does any one know any resources or tutorials of how to create a simple low polygon modeling application using DirectX (if no directX resources are available at least some general algorithms and stuff.) thankz

Share this post


Link to post
Share on other sites
Advertisement
Lessons I learned from my own modeling app:

1. Before you begin, decide what vertex format you want to work with - probably something like: position, normal, tex coords and diffuse color.

2. Decide how your model will be represented internally (I use a standard D3DXMESH with 3 vertices per face) and how you will save and load models (I used x-files to start with and added other formats later).

3. Decide on a method for "undo." If you don't build in the ability to undo several operations, it is extremely difficult to add it later. In my own app, I stack each operation (local & global SRTs, vertex selection and movement, face selection, etc.) and apply the entire stack to a base mesh to create a display mesh. To "undo" an operation, I pop the last operator from the stack and rebuild the display mesh. The user has the option to "freeze" the model at any point - apply all the operations to the base mesh to create a new base mesh. Then clear the operations stack.

4. Decide what operations you want to provide when modeling: such as object selection (if you want more than 1 model on the screen at a time); local and global scale, rotate and translate for the object; vertex selection and translation; face selection to create attribute groups; etc.

5. Decide whether your eyepoint will be fixed and the user will rotate, translate and zoom the model for viewing; or the object is fixed in space and the user will move the camera around for viewing. For easier calculations, I move the eyepoint relative to the selected object.

6. Decide whether you will have 1 view or multiple views on-screen at one time. If you're going to have multiple views, will they be separate windows or viewports in one window? I use 1, 2 or 4 viewports in a single client window.

7. Build the basic app, providing support for some of the features you've decided on above, but allowing for the other features to be added later.

8. Add the capability to view perspective, or front/top/right-or-left orthogonal views.

8. Add a "Create Grid" or "Create Quad" routine and create and display a simple quad comprised of two triangles. Allow for a parameter dialog to allow the user to select the number of grid points in the x and z directions (or the two axes or your choice).

9. Add the capability to display textured, shaded or wireframe.

10. Add the capability to display vertices and select them, probably using a selection rectangle. At this point, you will need to become very familiar with projecting, unprojecting and picking.

11. Add the capability to select faces (individual triangles) [picking]

12. Add the capability to move (translate) selected vertices.

Then comes the more difficult programming: how to add faces or new vertices to an existing model. I select one or multiple faces and extend any free edges of each face in the same plane as the existing face. The user can choose to extend an equilateral triangle or in a grid fashion (a right triangle).

Provide for the capability to select multiple faces, form a cluster of them and apply materials and a texture to the cluster, calculating tex coords spacially, spherically or cylindrically relative to the average vertex location or globally with respect to the origin. You will have to become familiar with the attribute buffer at this point, how to change it and (probably) optimize the mesh. Allow for later enhancements such as adding or removing a face from the cluster.

Something like that should keep you busy for a couple of hours. [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement