Monday, October 29, 2012
3D simulation of a lathe using solids of revolution, C# and openGL
After doing some research, I found out that most of the pieces made by the lathe were solids of revolution, and... I had a project named Solids of Revolution. After mixing that project with another project that loaded a workshop and had a FPS camera I had a prototype to work on.
The lathe was modeled in 3D max and I exported in 3DS format. The small engine I had (Shadowengine) eased the process of loading models and textures. after that I only had to get the blade position anytime I moved it and lower the radius of the piece in the blade position and generate the revolution on the only part.
I also added some particle to give more realism to the process and used my engine to play sounds.
here is the structure of the project:
It handles all concerning the lathe operations, the movement of the blades,etc.
It handles all concerning the drawing and creation of the piece, also the solid of revolution algorithm for lowering the piece.
It manages the drawing of the workshop and collitions.
It loads and saves all the data of the simulation to an XML file
The other classes are less important. I hope this project will be usefull to anyone who face a similar problem. If you have any questions ask it here in the blog.
Here is the download Link