|
This did not compile under gcc. I havent tried with visual studio.
|
|
|
|
|
oh.. so that's what it means...
Thanks!
Rafferty
"If better is possible, then good is not enough." - John Maxwell
|
|
|
|
|
I’m working on a project using VRML to show 3d shapes of all kinds. I now search a class (or tips of how to create one) to represent an arbitary shape. For e.g. se this pic:
http://www.ceco.se/xsim/ape/BoxWithSubtractionBox.GIF
One shape could for e.g. be a wall (a regular box). Later the wall could have a window.
Perfect would be if I in some way could create one box and later subtract one or many smaller shapes (the windows and doors) whenever I want.
For creating the VRML it then would be good to retrieve the outside areas of the shape (the connection of all corners).
All tips are welcomed.
_____________________________
...and justice for all
APe
|
|
|
|
|
Divide it in smaller shapes.
They call it meshing I think.
It's an intensive operation, but afterwards you can do virtually anything with it. (cutting, bending, translations ...)
Try searching on meshing or something?
Hope this helps a little.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
This is a task that might grow exponentially in complexity as new 3D shapes are added. If you haven't read up on 3D scenery data structure modeling, now is a good time to do so.
I don't know if there such a class, but what you'll need the following:
1. Track all vertices.
2. Track all edges.
3. Track all faces.
Also,
4. Define what characteristics a face can have (flat, convex, concave, etc.)
5. Define where the interior and exterior of a face is and what their characteristics are (solid, hollow, etc.)
Hmmm... upon further reading of your question, I realize that you already most likely know this and that you're asking for something else. Oh, well...
--
The Blog: Bits and Pieces
|
|
|
|
|
Johann Gerell wrote:
upon further reading of your question, I realize that you already most likely know this and that you're asking for something else.
No, all thoughts that makes my brain active are good.
I sure think there is some kind of algorithm out there that make what I want. Of course the best thing is to find it out myself but don’t really know where to start.
_____________________________
...and justice for all
APe
|
|
|
|
|
|
cmk wrote:
Constructive Solid Geometry
Thanks for that. To bad there is no article on CP.
I've looked at the link. Do you have others
_____________________________
...and justice for all
APe
|
|
|
|
|
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.
|
|
|
|
|
One way is to trap WM_SETTEXT for the main window and insert the new logic there.
Another way is to act in WM_NCPAINT, when the title area is painted. I wouldn't do that though.
Look in the MFC sources how/where the default title is composed.
--
The Blog: Bits and Pieces
|
|
|
|
|
Maybe GetWindowText(astring) and SetWindowText(astring) is an option, but I'm not sure you can get the whole string. you could try it and see.
Good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi Santosh,
I hope I'm on target with this.
In order to set the title of a document, hence the title of the MDI child window/main app window if the application is maximized, use CDocument::SetTitle().
You can call this in the view or in the document itself; the former would require GetDocument()->SetTitle(_T("Title"));
Jeff
|
|
|
|
|
hai,
i am doing a project on voice chat.I have some problems when it is used in the net.problems like echo,data loss.
(I had already posted this question and got the answer to use compression techniques)
My question is , is it necessary to go for VOIP concepts or just we can use compression techniques to solve that problem.
plz give some suggestions..
Thanks for all,
M.Kailasam
|
|
|
|
|
By default, in an MFC MDI application, when a child window is maximized, the
title of the child window is appended to the main window's title. Here I
want to display it in a custom format. How do I go about doing this ?
The application is an MFC MDI application.
The title bar text of the main window contains some values taken from a database.
So let's say the main title bar text is [Field1] - <field2> MainWindow
I have a MDI child window whose title bar text is Child1.
When the MDI child is maximized, the main window title will by default
become [Field1] - <field2> MainWindow - [Child1].
I want to change this and it should become - [Field1] - <field2> [Child1] -
MainWindow
Santosh
« Superman »
|
|
|
|
|
I have seen people use these macros on string literals, what are these for?
|
|
|
|
|
typedef WORD WCHAR;
#ifdef UNICODE
typedef WCHAR TCHAR;
#else
typedef char TCHAR;
#endif
so if UNICODE is defined TCHAR is WORD, else its char
|
|
|
|
|
Josh Gray wrote:
so if UNICODE is defined TCHAR is WORD
A typo. You mean TCHAR is WCHAR, of course.
And WCHAR is wchar_t.
--
The Blog: Bits and Pieces
|
|
|
|
|
_T is not the same as _TCHAR or TCHAR in respect to functionality.
_T , TEXT and also L are used to convert string literals to wide or multi-byte type. While _T and TEXT converts to wide if UNICODE is defined and to multi-byte if UNICODE is undefined, L will always force the string literal to wide independent of the UNICODE define.
So,
_T("This will be a string of WCHAR characters "
"if UNICODE is defined and of ordinary char "
"characters if UNICODE is undefined.");
_T("This will also be a string of WCHAR characters "
"if UNICODE is defined and of ordinary char "
"characters if UNICODE is undefined.");
L"This, however, will always be a string of WCHAR characters."; And WCHAR is just a wchar_t .
I highly recommend the article The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)[^] by Joel Spolsky.
--
The Blog: Bits and Pieces
|
|
|
|
|
Thanks. and what is a wide character wchar_t? the question is, when should I care to use these macros? or is it okay to not use them.
also, why do you use "L" like that - what does it expand to?
|
|
|
|
|
Normus wrote:
what is a wide character wchar_t
A UNICODE character. It uses (mostly) 2 bytes of storage instead of 1. Therefore "wide".
Normus wrote:
when should I care to use these macros
If you ask me - always (I come from Europe, where old ASCII is insufficient). If you ask an American - "What's Europe?"
Seriously, if you want anyone who needs a UNICODE alphabet to use your code, then it better be UNICODE enabled.
Normus wrote:
why do you use "L" like that - what does it expand to
L forces UNICODE type of the string literal. For example, code that targets no other OS than Windows CE, which is a UNICODE OS from bottom to top, can use L on all string literals and be sure to always work.
--
The Blog: Bits and Pieces
|
|
|
|
|
dont worry, I am not an american either
Regarding L, I am curious about the C syntax. Is it an operator or a macro or what is it?
Thanks.
|
|
|
|
|
I guess L is an MS compiler extension, because it's not a macro.
--
The Blog: Bits and Pieces
|
|
|
|
|
I want to do one project in VC++, that is in our Laboratory we are using one equipment for Blood Test & Urine Test that Equipment itself generating one report for us. But I want to connect that equipment to my system through Printer port and want to have control over equipment.This is my project brief description.
For to start this project I want some functions which will help to send the Data to equipment and to get response & Data from the equipment.kindly help.
|
|
|
|
|
The first thing to do is to find out if the equipment actually ACCEPTS commands through the printer port (which would be a little unusual - that type of control is usually done through a serial port). Are there any manuals for the equipment that describe the remote control capabilities and message and command formats? If so, then that is the place to start. Once you find out FROM THE MACHINE HOW IT WANTS TO TALK, then you can start the process of how to implement a communication protocol in VC++.
Hope this helps,
John
|
|
|
|
|
Hi
I careate a secondary worker thread in my application.
I read a sample that uses PostQuitMessage(0); to exit the thread..
But I know that I can just use return 0; instead..
when should each method be used ?
|
|
|
|