Click here to Skip to main content
15,901,373 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: (Beginner) unsigned int x : 2 Pin
Rafferty Uy14-Jul-04 15:27
Rafferty Uy14-Jul-04 15:27 
GeneralNeed a 3d shape class Pin
anderslundsgard13-Jul-04 20:56
anderslundsgard13-Jul-04 20:56 
GeneralRe: Need a 3d shape class Pin
V.13-Jul-04 21:14
professionalV.13-Jul-04 21:14 
GeneralRe: Need a 3d shape class Pin
Johann Gerell13-Jul-04 21:23
Johann Gerell13-Jul-04 21:23 
GeneralRe: Need a 3d shape class Pin
anderslundsgard13-Jul-04 22:30
anderslundsgard13-Jul-04 22:30 
GeneralRe: Need a 3d shape class Pin
cmk14-Jul-04 1:02
cmk14-Jul-04 1:02 
GeneralRe: Need a 3d shape class Pin
anderslundsgard14-Jul-04 2:05
anderslundsgard14-Jul-04 2:05 
GeneralRe: Need a 3d shape class Pin
vmaltsev14-Jul-04 5:29
vmaltsev14-Jul-04 5:29 
I think CSG that was mentioned in previous post is too complex for your task.
What you need is indeed a simple mesh object and elements of it were mentioned above as well.
Let's start with a simple class for 3D point (you can call it vector if you want) with all possible geometrical manipulations like add, sub, mul, dev with point, with scalar, dot and cross products.
After that you have to create a class to represent a face. If you remember geometry you know that three points in space is enough to represent a plane, so your "face" class have to include those three poins. Plus I suggest to include Normal Vector (normalized cross product of two differences between our three points, like p=b-a, q=c-a, n=cross(p,q) N=n/length(n)) which will represend visible side of a face and some props like single/double faced, shading method etc. Normal vector is very important cuz it'll help you to eliminate invisible faces on rendering stage.
Another thing that we have to include in our face class is info about edges. That's all.
Now to represent a normal 4-point plane you need 2 faces, so to represent a cube you need 12 faces.
All boolean operation are very simple to perform on such objects. You need to solve only one equation to find points in space where two faces intersect and create new faces there.

Hope it'll help.
GeneralRe: Main Window Title Pin
Johann Gerell13-Jul-04 20:51
Johann Gerell13-Jul-04 20:51 
GeneralRe: Main Window Title Pin
V.13-Jul-04 20:56
professionalV.13-Jul-04 20:56 
GeneralRe: Main Window Title Pin
Jeffrey Walton14-Jul-04 12:44
Jeffrey Walton14-Jul-04 12:44 
Generalhelp reg voice chat Pin
Member 101812813-Jul-04 20:47
Member 101812813-Jul-04 20:47 
GeneralMain Window Title Pin
«_Superman_»13-Jul-04 20:26
professional«_Superman_»13-Jul-04 20:26 
General_T, _TCHAR and TCHAR Pin
normus13-Jul-04 20:24
normus13-Jul-04 20:24 
GeneralRe: _T, _TCHAR and TCHAR Pin
User 58385213-Jul-04 20:38
User 58385213-Jul-04 20:38 
GeneralRe: _T, _TCHAR and TCHAR Pin
Johann Gerell13-Jul-04 20:57
Johann Gerell13-Jul-04 20:57 
GeneralRe: _T, _TCHAR and TCHAR Pin
Johann Gerell13-Jul-04 21:10
Johann Gerell13-Jul-04 21:10 
GeneralRe: _T, _TCHAR and TCHAR Pin
normus13-Jul-04 22:46
normus13-Jul-04 22:46 
GeneralRe: _T, _TCHAR and TCHAR Pin
Johann Gerell14-Jul-04 0:39
Johann Gerell14-Jul-04 0:39 
GeneralRe: _T, _TCHAR and TCHAR Pin
normus14-Jul-04 3:16
normus14-Jul-04 3:16 
GeneralRe: _T, _TCHAR and TCHAR Pin
Johann Gerell14-Jul-04 3:57
Johann Gerell14-Jul-04 3:57 
QuestionHow to interface System to External Hardware Pin
zahoor ahmed13-Jul-04 20:08
zahoor ahmed13-Jul-04 20:08 
AnswerRe: How to interface System to External Hardware Pin
jhorstkamp13-Jul-04 23:24
jhorstkamp13-Jul-04 23:24 
QuestionWhen to use PostQuitMessage ? Pin
Hesham Amin13-Jul-04 19:47
Hesham Amin13-Jul-04 19:47 
AnswerRe: When to use PostQuitMessage ? Pin
ThatsAlok13-Jul-04 20:09
ThatsAlok13-Jul-04 20:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.