akb825
2006.04.09, 04:46 PM
I have mentioned my current project a few times, but now it's time for me to reveal it. I am working on an API called Monkey3D and an accompanying utility, Monkey Modeler. In a nutshell, Monkey Modeler loads 3D models in obj format, will let you add such things as additional textures, select texture generation modes, generate a shadow mesh (basically a version of the mesh with flat normals as well as 0-length quads of every edge so it can be easily extruded to form a shadow volume; note that this only works if every object in the model is closed; also, you can choose to create a shadow mesh for only certain objects in the model), and add collision surfaces. (supported surfaces include boxes, spheres, capped cylinders, and rays) All these are now completed, and afterwards I will add the ability to create skeletons and animations to the models, then save the skeletons and animations separately to bind to different models.
Here's a couple of screenshots from the modeler.
http://www.akb825.com/images/modeler%201.png
http://www.akb825.com/images/modeler%202.png
The API will load the files you want, call a function you provide to load the included textures (it's also very easy to bind your own textures), and draw the models. You can choose to draw only parts of the model, use vertex shaders, and tell it to draw the shadow portion of the model. You can also test for collisions between models and other collision surfaces you create. It includes a completely working version of the ODE library within the API (I also got the trimesh portion of it included! I had to add about 900 namespace resolutions to get it to compile, though), and I use it to handle collisions. You can, of course, use the physics portions of it as well. Later, I will add the ability to open and bind the skeleton and animation files, as well as the functions to animate each object.
For a complete list of features, you can visit the page on my website (http://www.akb825.com/monkey3D.php).
Now for the demonstration.
Demo download (http://www.akb825.com/downloads/Monkey3D%20demo.zip)
I have created an application to demonstrate the various capabilities so far. You can control it by selecting one of the movement modes and using the mouse or arrow keys to move around. You can also press 't' to translate, 'r' to rotate, and 'z' to zoom if you don't want to move. (scroll wheel always zooms) You can also use a check box to enable vertex shaders (if they are available on your computer) and to use VBOs.
The application has 3 sections:
First section demonstrates two models with built-in textures, with the relative path saved with the models. It also demonstrates shadows. When vertex shaders are enabled, check the sow shadows box to see them in action. It also sports self-shadowing.
Here are some screens of the first section with shadows in case you can't see them.
http://www.akb825.com/images/shadow%201.png
http://www.akb825.com/images/shadow%202.png
The second section demonstrates collision detection. The 4 objects represent the collision detection surfaces of the same size and orientation. You can check the box to move the selected object, and select an object from the table. Here's a screen of that.
http://www.akb825.com/images/collisions.png
The last section demonstrates the ability to save tex-gen settings, as well as the ability to emulate them in vertex shaders. Whenever you provide a vertex shader, you provide just the base shader, pass that in to a function along with a model, and it adds the particular parts it needs to handle each of the texgen modes selected. All the shaders are held in an array.
To load the cubemap, I loaded the images into a texture object and had a 2-line loop to add it to the model: all I did was set the texture object and dimension for each object in the model. Here's a screen for that section.
http://www.akb825.com/images/cube%20map.png
This demo is a universal binary, and hopefully everything will load fine on Intel Macs. It will only work on Mac OS X 10.4 or higher. I tried to lipo myself a 10.3.9 universal binary, but unfortunately it throws nonsensical errors in the ODE library (such as needs , or ) before a numerical constant in the declaration of a parameter for a function) when linking to any SDK except for the universal one. I hope to have the final version available of the API and utility for 10.3.9 if I can ever figure that one out.
Here's a couple of screenshots from the modeler.
http://www.akb825.com/images/modeler%201.png
http://www.akb825.com/images/modeler%202.png
The API will load the files you want, call a function you provide to load the included textures (it's also very easy to bind your own textures), and draw the models. You can choose to draw only parts of the model, use vertex shaders, and tell it to draw the shadow portion of the model. You can also test for collisions between models and other collision surfaces you create. It includes a completely working version of the ODE library within the API (I also got the trimesh portion of it included! I had to add about 900 namespace resolutions to get it to compile, though), and I use it to handle collisions. You can, of course, use the physics portions of it as well. Later, I will add the ability to open and bind the skeleton and animation files, as well as the functions to animate each object.
For a complete list of features, you can visit the page on my website (http://www.akb825.com/monkey3D.php).
Now for the demonstration.
Demo download (http://www.akb825.com/downloads/Monkey3D%20demo.zip)
I have created an application to demonstrate the various capabilities so far. You can control it by selecting one of the movement modes and using the mouse or arrow keys to move around. You can also press 't' to translate, 'r' to rotate, and 'z' to zoom if you don't want to move. (scroll wheel always zooms) You can also use a check box to enable vertex shaders (if they are available on your computer) and to use VBOs.
The application has 3 sections:
First section demonstrates two models with built-in textures, with the relative path saved with the models. It also demonstrates shadows. When vertex shaders are enabled, check the sow shadows box to see them in action. It also sports self-shadowing.
Here are some screens of the first section with shadows in case you can't see them.
http://www.akb825.com/images/shadow%201.png
http://www.akb825.com/images/shadow%202.png
The second section demonstrates collision detection. The 4 objects represent the collision detection surfaces of the same size and orientation. You can check the box to move the selected object, and select an object from the table. Here's a screen of that.
http://www.akb825.com/images/collisions.png
The last section demonstrates the ability to save tex-gen settings, as well as the ability to emulate them in vertex shaders. Whenever you provide a vertex shader, you provide just the base shader, pass that in to a function along with a model, and it adds the particular parts it needs to handle each of the texgen modes selected. All the shaders are held in an array.
To load the cubemap, I loaded the images into a texture object and had a 2-line loop to add it to the model: all I did was set the texture object and dimension for each object in the model. Here's a screen for that section.
http://www.akb825.com/images/cube%20map.png
This demo is a universal binary, and hopefully everything will load fine on Intel Macs. It will only work on Mac OS X 10.4 or higher. I tried to lipo myself a 10.3.9 universal binary, but unfortunately it throws nonsensical errors in the ODE library (such as needs , or ) before a numerical constant in the declaration of a parameter for a function) when linking to any SDK except for the universal one. I hope to have the final version available of the API and utility for 10.3.9 if I can ever figure that one out.