Infinity08 > thanks for the post, could you detail how much of which bits it would do and how much i would have to do?
Main Topics
Browse All TopicsHi all,
I have just purchased C++ Builder 2007. Since I'm very used to Delphi 2007 I thought that it would be a great way to get into C++.
Setting my sights rather i high, i am hoping to construct a program for making custom wireframe models. However I need a large amount of advice on what 3D engine / component / library to use. Please note i have very little 3b programming knowledge so if some of the list below are impossible please do say.
As far as i can work out my requirements of the engine would be:
> Able to handle 50-150K+ line being drawn (higher the better)
> Anti-analyzing would be a huge plus!
> Able to handle zooming in, rotating and moving around the display
> I will need some way of finding out which line has been selected - i dont know if the engine could help with/ do this?
> Speed is not a huge issue (as long as it can do 5 Fps Im happy :) )
> Very high resolutions needed. I would like to be able to produce images around 2-4k by 2-4k pixels (obviously this is off screen drawing)
> Able to save current image to disk in bmp or jpeg
> This is a hobby program so the engine would need to be free! (or very very cheap!)
All comments welcome - Points will be awared for suggested engines AND for Good Advice.
Thanks in advance
David
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
OpenGL is just a framework for drawing 2D and 3D scenes. It provides low-level functions to do that, like drawing a point, a line, etc. So, it can pretty much do everything you want, although, you'll have to work with it on a low level.
There are several plugins/libraries available that provide higher level functionality if you need it.
To take your requirements one by one :
>> > Able to handle 50-150K+ line being drawn (higher the better)
I don't have performance statistics here, but OpenGL is used in very demanding applications (including games), so i'd say yes.
A lot depends on your own code though - adding optimizations yourself will get you a long way !
>> > Anti-analyzing would be a huge plus!
I assume you mean anti-aliasing ? If so, yes :
http://www.glprogramming.c
>> > Able to handle zooming in, rotating and moving around the display
All of that is done by simple matrix transformations (to move the camera and/or the scene around). Refer to some basic tutorials on OpenGL to tell you more about how to do this.
>> > I will need some way of finding out which line has been selected - i dont know if the engine could help with/ do this?
I'm not sure what you mean, but you have to keep track of your lines, and then you'll be able to know which one you're working on.
>> > Speed is not a huge issue (as long as it can do 5 Fps Im happy :) )
You'll get the speed anyway if you write your code correctly ;)
>> > Very high resolutions needed. I would like to be able to produce images around 2-4k by 2-4k pixels (obviously this is off screen drawing)
Resolution is configurable when you set up the scene.
>> > Able to save current image to disk in bmp or jpeg
I assume that there are plugins to do this - you'll have to look around a bit ...
>> > This is a hobby program so the engine would need to be free! (or very very cheap!)
It is !!! :)
hi david,
in addition to what infinity said already .. you can find a lot of good opengl-lessons with full source code
at http://nehe.gamedev.net/ for Borland C++ as well ..
here is a very basic one abount drawing a triangle and a square:
http://nehe.gamedev.net/da
dont worry about the solid objects, you can tell opengl to draw only the lines of the objects rather than drawing it as a solid object by just setting one flag ..
> I will need some way of finding out which line has been selected - i dont know if the engine could help with/ do this?
here is a nehe-lesson about that called object-picking:
http://nehe.gamedev.net/da
> Able to handle 50-150K+ line being drawn (higher the better)
theoretically the amount of used objects is only limited by your memory and cpu-power. if you have a lot of objects there are technics to only render the visible parts of your scene .. which is called "viewport/frustum culling"
you will find a lot of other good examples about opengl in the net. in addition i'd recommend you the *bible of opengl* the "red book":
http://www.opengl.org/docu
i own one myself .. its very good and comes with very basic examples even for complicated things. there are lessons about object-picking and anti-aliasing too ..
and of course you can always get hepl here at ee, there is an opengl area here:
http://www.experts-exchang
so i wish you a lot of fun discovering and playing .. good luck :)
ike
Since it is C++ Builder:
There is an ongoing series of articles about DirectX9 and C++ Builder at C++ Builder Developers Journal: http://www.bcbjournal.com and http://bcbjournal.org
The author is myself and already there are the following classes documented:
TCDX9Screen: Handles whatever had to deal with the display device.
TCDX9Font: 2D fonts handling class
TCDX9Camera
TCDX9Lights: A light manager class
TCDX9Model: handles 3D objects, loading-placing-scaling-ro
Next in series (September and later)
TCDX9HModel: For 3D hierarchical models that means with animation and complex models contains many meshes.
Of course shaders and effects will be added later...
NOTE:
Those classes are FREE and will remain....
After creating all classes needed and test that they work as needed it's panned to be made VCL components.
At bcbjournal homepage you will find a link to download a demo application without code for this time.
The code will be added next month..
George Tokas.
Hi, David,
Seems you are new to 3D. If so, let me suggest to start from the begin.
First to draw single 2D lines, by using only the VCL/VCX library.
Sorry for the very basic example, but this is a mandatory step. If you know about that, spik it.
In a new Builder C++ project, put the code below, after double-clicking in the Form1 OnDraw event:
void __fastcall TForm1::FormPaint(TObject *Sender)
{
Canvas->MoveTo(0,0);
Canvas->LineTo(ClientWidth
Canvas->MoveTo(0, ClientHeight); // or int variables
Canvas->LineTo(ClientWidth
}
This draws both diagonals in the form.
If you want to draw new diagonals when resizing the form, then click in the OnResize event and chose FormPaint in the drop list.
If you want to erase the previous diagonals... well, this is a good suggested exercise...
Also how to draw ellipses/circles, rectangles/squares, filled, any color.
Please pardon me for so naif tutorial, but if you are unfamiliar to computational geometry, it is a start...
On must dominate that basics before flying higher.
As stated before, OpenGL and DirectX are complete 2D/3D API's.
OpenGL is free and portable (Windows, Linux, Unixes). OGL is stable. Last is Version 2.1.
DirectX is download free and portable between Windowses. DX has new flavours every season: 9, 9a,...,9c, 10... DX has direct import/export for 3D models for Maya and 3Dmax, maybe interesting in your case.
OpenGL has a medium to long learning curve. Not so simple as the diagonals above. You must understand its pipeline, matrix operations, shaders. The coordinate space, fulcrum, projection plane, etc. You must understand that. As pointed previously, Nehe site is a great place for tutorials. I am an enthusiast of such site. You must have a good reference book also. Mine is OpenGL Programming Guide, 5th. Ed., by Dave Shreiner at al., Addison-Wesley. It covers version 2.
Finnaly, about 3D modeling.
If you intend to develop an application for modeling, you may want take a look on how others developers have solved this subject. There is a number of different approaches: Constructive Solid Geometry (you add poyhedra, make boolean operations with them), Mesh (you describe surfaces), Elevations from bitmaps, etc. Let me suggest download trial copies of 3dMax, Maya, trueSpace (pretty creative interface, BTW version 3.2 is free), or buy cheap copies of Bryce at ebay. You can evaluate each solution for the interactive interface.
Three dimensional modeling is a difficult task when we want create creatures, human characteres or cartoon animals. As your target is wireframe modeling, probably you think in lines... humm... this is not a good approach. To create 3D models, think on polygons or meshes instead. Most models around are a large set of triangles (OpenGL works very well with triangles).
Anyway, if working only with 3D lines is a must, you can also think about vector construction. But I think that this is the dark side of modeling...
Jose
Thanks all,
Its been really interesting reading through your posts and related links, I certainly have alot to learn in this area. It looks like opengl is the way to go :)
Still one quick question though, all the examples linked to show opengl apps as either full screen or as new windows.... is it possible to get an opengl window within an existing form? Similar to a TImage/Tpanel ? or will i have to go down the MDI child forms route?
I look forwards to point-splitting at the end of the weekend
Thanks again
David
>> is it possible to get an opengl window within an existing form?
that depends on the gui-toolkit you use. MFC/Qt/wxWidget .. but all of them provide the possibility to have a subwindow showing the opengl-context ..
sorry, but i dont know about C++-Builder GUI-Classes .. but i'm quite sure they provide a mechanism like that too ..
ike
As you use Borland Builder C++ you may want.take a look at
http://www.geocities.com/s
Mr. Enzo has developed an interesting toolkit to integrate BCB and OpenGL, although you can use BCB in MSVC fashion (which is a waste of resources...).
About create an OpenGL on a TPanel, yes, you can make your applicatin that way. At Allan Petersen site you can learn how to do it.
http://www.opengl.allanpet
Jose
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup Zone:
Split: Infinity08 {http:#19768445} & ikework {http:#19770732} & gtokas {http:#19770964} & JoseParrot{http:#19779826}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
Sean
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: Infinity08Posted on 2007-08-25 at 08:57:43ID: 19768259
OpenGL will do all that you want (with a little work by you) :
om/red/
http://www.opengl.org/
It's free, very powerful, and frequently used in graphical applications.
A short guide on OpenGL programming :
http://www.glprogramming.c