Tuesday, January 3, 2012

3D Cylinder Revolution Models Creator with UV Mapping

For one of my project, i have to create some models quickly.
I haven't 3DS max ,Blender or something like that and i don't have the time to learn them ...
So, i create a tool to make those models like i want !
Before this project, I did not have much idea on how a model was built.
So I learned a lot through this project.
I advanced in C + + and especially in QT.
I learned OpenGL and UVMaps!
And I did a lot a lot of math! (Rotation, Scaling  ... LOve Atan2 and Pythagor :) )
All control was made by me, dots, lines, coloration, ect ... everything , just with the usage of QPainter on a QWidget :)

My project :
To achieve cylindrical objects, simply create points of an edge of the object and apply a rotation on the central axis by 360 degree.
Personally I did not actually use 360 degrees rotation, but I have defined a number of face for the final object.
After this, i can apply a texture on my model.
For this, i use the UV Mapping technique which is use by a lot of 3D format ( like .obj or .dae , my wanted format )
This technique allows you to place precisely the desired texture on one side of the object.
I realize an unfolding of my 3D object (the first thing seen is complex, but it's finally relatively easy)
After unfolding my model, I put those unfolding faces on my texture like i want :)
To finish, i can export my new 3D Object into my desired format ( obj | dae )

Here a preview of my tool :


No comments:

Post a Comment