Thanks Zarfius for the comments that made me reply and write down the "goals", now I can just copy it here.
[size="3"]The goals of the application
Due to my relatively poor English, I can't really use the term "goal". In my previous entry, I was talking about my "goals", in this paragraph, I'll write about the application's "goals" (what it does).
The program is for aiding paper modelling, which has nothing to do with computer games. So the main feature is precise unfolding polygon meshes (so it's not the same as UVW unwrapping). I know there are many programs and plug-ins for that, but all the programs I found during a small research was either not "to my liking" or was "expensive". Some of them have manual unfolding (polygon-by-polygon, which is very tedious), some of them are only suitable for low or very-low poly models, some of them produces crappy unfolded geometry or are tedious to work with. And as far as I saw, none of them take the thickness of the paper into account (which is 0.5 mm for the cardboard I worked with for example).
A main goal is to make an algorithm that produces the best output with the least input even with high-poly meshes. Easily and intuitively modifying the unfolded geometry is a must too. And of course printing/plotting the result with different line types and textures. Later I'll add more features, like modifying surfaces of the original 3D mesh to be unfoldable (it's hard to explain what I mean by that); making slices of the mesh for layered paper structures; automatic/manual adding of "flaps" to the edges to be glued together, maybe basic documentation tools like guidelines, arrows, numbers, comments, assembly drawings, etc.
More explanations in my old blog, I don't want to rewrite/copy the whole thing here.
[size="3"]The Progress
Unfolding
Reused the code from the previous version, and added new features like
- automatic welding of unfolded vertices/edges
It's hard to explain why I need this. So see the first three images of an unfolded box. Second: with welding, third: without welding. You can see how the algorithm builds up the unfolded geometry. - displaying the split (cut up) edges in the 3D view
and added an "unfold edges only" edge selection method. Of course, welded edges are not displayed - textures
really just using the same texture coordinates as the original mesh - sharp edges are rendered as broken lines
- triangle identifier numbers on 3D and unfold geometry
This is just the beginning. I plan to add a lot of other and powerful features to it to generate much nicer geometry that needs fewer further manipulation.
And of course taking the thickness of the paper into account. That will be a huge pain in the ass. Maybe I should start with a *perfect* shell generation algorithm (offsetting the faces). Well, even 3ds MAX cannot do that....
You can read more about the algorithm if you like, here.
GUI
I played (struggled) with it a lot, programming-wise. With the help of Gamedev of course. Now it has expandable/shrinkable groupboxes, and the whole "Right Panel" is scrollable with left mouse button drag. It still flickers (I didn't dare to use WS_EX_COMPOSITED style for the panel), but (IMHO) feels/looks quite slick. And it will be helpful in the near future, because I still haven't bought a new monitor, and the current has an approx 200x200 pixel dead area at the botton-right corner.
Of course, it's far from finished/polished, but at least I can forget about it for a while.
[size="3"]"Concerns"
Or whatevers... I still have no idea about the mechanics of the editor. Especially the mechanics of unfolding.
I unfold the geometry, then I edit the unfolded geometry, then I press unfold again, and Bam! all the editing is lost. Or maybe every unfolding should go on a new "Sheet"? (if the user wants of course). After unfolding, the 3D and the unfolded geometry should be totally separately handled? What about other stuff in the future? When I add new meshes, like layered things of the 3D mesh? How about importing new meshes?
Maybe the user could select which sheet the new unfolding should go, and override the unfolded geometry on that sheet?
So a lot of brainstorming and design is ahead of me.
[size="3"]Images
The first three demonstrates the welding stuff. The box is segmented only for testing this feature.
The other seven images are about the unfolding of the car model, modified by edge selection. The algorithm splits (cuts) the geometry at selected edges. It took me about ten minutes to make it (excluding 3D modelling). I tried two variations for the roof.
The last three shows the GUI.
I got a bit obsessive about purging flicker on the GUI for mine. I found WS_EX_COMPOSITED didn't work, can't remember the details, so in the end I went with doing WS_CLIPCHILDREN with everything, and manually InvalidateRect-ing the children of controls recursively. My situation was slightly complicated by having a bitmap background drawn as the background of the main window but it is quite possible to get rid of flicker completely, although largely irrelevant to the functionality of an application.
Have you considered using the default GUI font for your GUI stuff instead of that fixed font? I was reading that DEFAULT_GUI_FONT is frowned upon so used this to create mine:
[source lang="cpp"]
void Application::CreateGuiFont()
{
NONCLIENTMETRICS Nm;
Nm.cbSize=sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),&(Nm),0);
LOGFONT L=Nm.lfMenuFont;
HDC Dc=GetDC(Hw);
strcpy_s(L.lfFaceName,"MS Shell Dlg");
L.lfHeight=-MulDiv(8,GetDeviceCaps(Dc,LOGPIXELSY),72);
ReleaseDC(Hw,Dc);
L.lfQuality=CLEARTYPE_QUALITY;
GuiFont=CreateFontIndirect(&L);
}
[/source]
Then I just send a WM_SETFONT message to all controls. Just a thought, ignore me, don't let anything distract you from the sterling job you are doing on the actual application functionality and rendering, which both look top notch to me.