|
|
| CSG Editor | 8.2.2004 | Jozef Wagner |
|
|
|
 | CSG Editor |
|
NEWS : read tutorial on how to compile it on my news page
NEWS : Tutorial is also avaiable on this page in Other section
CSG Editor is program for realtime CSG. It is using OpenCSG and OpenGL. It is developed under Visual C++ 6.0 and it requires good graphics accelerator (GF 3, ATI Radeon 8500 or higher)
|
Status :
 | Finished |
 | Free (both program and source code) |
|
 | Description |
|
This program uses CSG for rendering objects. CSG stands for Constructive Solid Geometry. It is technique for creating complex object from simple primitives (sphere, box, cylinder ...) by 3 operations : Union, Subtraction and Intersection.
With this program, you can create those objects in realtime. CSG Editor is using OpenCSG for computing CSG and OpenGL for rendering.
It is also recommended that you have a good graphics accelerator (I personally recommend ATI Radeon). You can create CSG by creating primitives and CSG tree. Program has extensive help with tutorials.
For more Information about CSG in general, read help in CSG Editor.
Because I used my native language in source code quite often, I've translated some slovak words I used in a lot for you :
- teleso - body, solid, object
- strom - tree (csg tree)
- uzol - node (in csg tree)
- pocet - count
|
 | Features |
|
- Working under Windows 98/Me/NT/2k/XP
- developed under Visual C++ 6.0
- using OpenGL
- using OpenCSG
- create CSG by building normalized CSG tree on the fly
- 4 primitives : Sphere, Box, Cylinder and Torus
- transformation operations (rotation, scale, ...)
- more than 10 presets
- more than 30 textures
- full mouse camera and transformation control
- texture sets
- screenshot support
- English language (program and help)
|
 | Download |
|
to successfully compile program, you will need to download OpenCSG and GLUT. Read tutorial on how to compile it HERE !!!
read Other section on this page for known bugs and program notes to avoid asking me things which are explained here
|
 | Screenshots |
|
|
|
 | Other |
|
Notes :
- If program crashes when rendering CSG, you do not have good graphics accelerator. Buy a new one
- If you want to know password for source codes, contact me. read FAQ for more info why I passworded source codes
- Creating CSG using stencil buffer has one big disadvantage. Result is only an image. It does not create vectors, so you can't export CSG into CAD application.
Bugs :
- FPS counter sometimes shows strange things
- when no primitive is created AND/OR no tree is created, clicking on some butons can cause program to crash
- zooming too close will mess CSG. This is caused by OpenGL not rendering things behind camera
- CSG with concave primitives is messed in SCS algorithm. This is not a bug, it is a feature. Use GF algorithm for rendering concave primitives
TODO :
- program is finished, if you want to add some features, tell me
Tutorial :
I've got numerous requests about CSG source code and some of you don't know how to compile it, so I'll give you step by step howto.
NOTE : You can't compile it under MSVC .NET (well you can, read about it further)
NOTE : The solution I present here is not the only one but it is will less fill your system with useless files
- THIS IS FOR MSVC 6.0 !!!!
- Create some directory, where you will have this project (Mine is C:\temp\CSG )
- Download CSG binaries : http://neuron.tuke.sk/~wagner/files/csg-program.zip
- Download CSG source code : http://neuron.tuke.sk/~wagner/files/csg-src.zip (ask me for a password)
- Download newest OpenCSG : http://www.opencsg.org
- Download GLUT binary : http://www.xmission.com/~nate/glut.html
- Unpack it all to different directories. Now you should have something like this :

- Copy glut.h from glut-3.7.6-bin directory to include directory for your visual studio ( C:\Program Files\Microsoft Visual Studio\VC98\Include\GL )
- Run Microsoft Visual Studio 6.0
- Load OpenCSG project and compile ALL 3 projects under both Debug and Release version (Build - Batch build - Rebuild All)
- Load CSG project.
- Change active configuration to Release (Build - Set active configuration - Release)
- Open Project - Settings and :
- - In debug tab, set working directory to CSG probram ( C:\temp\CSG\csg-program )
- - In C\C++ tab and Preprocessor category, set Additional Include directories to this : C:\temp\CSG\OpenCSG-1.0.0\include;C:\temp\CSG\OpenCSG-1.0.0\glew\include\GL (obviously change directories to reflect yours directory structure)
- - In link tab and Input category, set Additional library path to this : C:\temp\CSG\OpenCSG-1.0.0\lib;C:\temp\CSG\OpenCSG-1.0.0\glew\lib (obviously change directories to reflect yours directory structure)
- Build project and run it :)
Visual studio .NET changes:
- I was not able to run program sucessfully. It was buggy when rotating object (Problem is somewhere in Run() or onidle functions or camera.cpp but I'm too lazy :p )
- Make changes like mentioned above (obviously settings in MSVC .NET are in slightly different places)
- You have to deal with m_msgCur, because it is not in .NET (you can use _AFX_THREAD_STATE* pState = AfxGetThreadState(); to obtain m_msgCur)
- comment out content of CCSGView::GetGLInfo()
- add /FORCE and /NODEFAULTLIB:libc.lib to link parameters in project settings
|
|