|
Yes you are right, its to be used in 3D. I am not good in this domain. The docs for that double value say "angle in radians rotated from +ve world x-axis". Does this indicate something ?
update: Now I understand that I need a vector, along with the angle for the conversion, but that vector is no where to seen in the information object for the text box. Is ther anything I can use as default for +ve world x-axis as it says above.
Its never over !
|
|
|
|
|
shaibee wrote: Now I understand that I need a vector, along with the angle for the conversion
If your object is actually existing in 3D space then you should have everything you need. You can create your quaternion as follows:
Quaternion Q;
Q.x = x * sin(Angle/2);
Q.y = y * sin(Angle/2);
Q.z = z * sin(Angle/2);
Q.w = cos(Angle/2);
Best Wishes,
-David Delaune
|
|
|
|
|
I am reminded of when I told a programmer that OpenGL didn't understand "2D". when you deal with 2D references all you are doing is nulling/zeroing the other rotations. If Z is into the screen (a common reference) then heading is your rotation of a window plane clockwise. All other references would be zero. So you can easily use 3D references to modify 2D parameters. If you write your own window compositing display a flip forward would be pitch and flip left/right is roll. you cand do some pretty cool displays.
the hardest part is Euler to quaternion is reference specific. Is +Y out of the screen? is +Z into our out of the screen? so you have to watch your references.
in reality you don't need to choose. If you are using only one view, one rotation, you can fake it by choosing an angle and always using that one for window rotation. You might get into trouble when you try to share, but you will find quaternions pretty lie/mistake proof as long as you are carefully consistant.
I prefer thinkin in top down 3D where window rotation clockwise is Euler heading.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
|
|
|
|
|
|
Just part of the 32 bit color depth picture is displayed when my program runs in XP while in win server it is fine.
I made a new MFC application with .net 2005 and all i have done was that i put a picture control on the form and the picture that it displays is a 32 bit color depth
Any solutions????
Thanks in advance
|
|
|
|
|
fire storm wrote: Any solutions????
I don't see a question, only some vague statements. This seems to be the norm on codeproject lately. I would recommend that you clarify your statements and form a proper question. How to get an answer to your question.[^]
Are you referring to the CStatic based picture control available in the VC toolbox? How are you loading/painting the 'picture'? What bitmap format is the picture. Are you loading it from disk or from resource? What API are you using to read bitmap?
Best Wishes,
-David Delaune
|
|
|
|
|
Can you more explain for your problem you have a control(for example static control) and you loaded a picture on it then...?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
My problem: I made
1- A new MFC application (exe) (c++ .net 2005), dialog based.
2- Get from the toolbox a control which is "Picture".
3- Set the type of the control to Bitmap in the property window of the control.
4- Add new bitmap to the resources at which this bitmap is 32 bit color depth picture.
5- Set the Image property of the "Picture" control to the previous Bitmap ID in the
property window of the control.
6- Build and run the application on WinXP and make sure that the appliction is enabling XP theme.
Note to enable it if it is not enabled write this line in "Additional Manifest Dependencies"
in linker node, in Manifest file Node:
type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'
When I do all this steps just part of the picture is displayed while if take the application and run it in Win server the picture is displayed perfert.
I hope that explains my problem.
|
|
|
|
|
How to attach a child toolbar to parent toolbar. Please help me.
|
|
|
|
|
huh ?
Care to explain what you mean by that ?
|
|
|
|
|
What do you mean ?
|
|
|
|
|
I am having a main toolbar. Now i want to attach another toolbar at the end of main toolbar.
|
|
|
|
|
Roay wrote: child toolbar to parent toolbar
I think you made a toolbar and also you have a standard toolbar on your program but what do you need exactly?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Yes.I am having a main toolbar. Now i want to attach another toolbar at the end of main toolbar.
|
|
|
|
|
can someone please help me out in this regrad..
im a newbie to c++ and first task is assigned for me..
i have a service running in the network which will send output in XML format..i have to fetch the command from the service and based on the data have to trigger a action in another application.
can i use socket communication programming in c++ to get the xml output or is there any other method i can use.. its very urgent please someone help me asap
|
|
|
|
|
You may want to start with figuring out how the service is
providing the data you need...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you.. they have given in the manual that by sending commands,i ll be able get the response like this
<authorization isloggedin="Boolean" alarm="integer<br" mode="hold">Design=integer Operate=integer AC=integer/>
please help me
|
|
|
|
|
Hello,
I need to use a DLL which was written in Delphi in my VC++ windows forms application. However, Delphi doesn't generate a .LIB file when creating DLL's so I have to create a .LIB file manually. I have already written a .h file for the functions that I need to use. The .h code is shown below.
<br />
1
2 extern "C" { <br />
3 <br />
4 __declspec(dllexport) void* __stdcall CITRemote_create( <br />
5 void *parameters ); <br />
6 <br />
7 __declspec(dllexport) int __stdcall CITRemote_open( <br />
8 void* handle, void* parameters); <br />
9 <br />
10 __declspec(dllexport) int __stdcall CITRemote_close( <br />
11 void *handle ); <br />
12 } <br />
From what I understand I need to create a .DEF file to generate a .LIB file with the LIB command: lib /def:CITRemote.def. The .DEF file I wrote is shown below.
<br />
1 ;File: CITRemote.DEF <br />
2 LIBRARY "CITREMOTE" <br />
3 <br />
4 EXPORTS <br />
5 CITRemote_open <br />
6 CITRemote_close <br />
7 CITRemote_create <br />
The name of the DLL is CITRemote.dll and uses the STD calling convention. After I execute the LIB command, CITRemote.lib and object CITRemote.exp are created. I added the lib and exp file into my project in the 'Resource Files' filter. When i try to call for example the CITRemote_create function, I get the following error:
<br />
Linking... <br />
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification <br />
1>NTP checker.obj : error LNK2001: unresolved external symbol "extern "C" void * __stdcall CITRemote_create(void *)" (?CITRemote_create@@$$J14YGPAXPAX@Z) <br />
1>C:\Documents and Settings\Aartun\My Documents\Visual Studio 2008\Projects\NTP checker\Debug\NTP checker.exe : fatal error LNK1120: 1 unresolved externals <br />
So i guess the implementation of the function isn't found, thus meaning it doesn't link the DLL. But what am I doing wrong, did I miss something?
Thanks in advance.
Note: I'm using Visual Studio 2008 Proffesional and all the files(dll, lib, h, exp and def) are in the same directory.
|
|
|
|
|
You want to change the CITRemote.h file to say __declspec(dllimport) rather than __declspec(dllexport).
You are specifying that you want to export those function from your Windows forms app. Then, when you link, it can't find an implementation for them - because the implementation is in the Delphi DLL....
As an aside - if you were using the linker packaged with GCC, you wouldn't need a .LIB file - it can link directly to DLLs. I've often wondered why Microsoft's linker didn't have that capability.
|
|
|
|
|
i need accuracy as well as i have to interact several time with user interface .if i use multimedia timer for accuracy then it slows my interface response.how could i achieve both accuracy as well as quick response from interface??
i read about queue timer form msdn that it is accurate as well as do not stop window messaging .but when i used this,this is n't accurate..
|
|
|
|
|
If you want a responsive interface while doing some other activity at the same time no matter what that activity is, then you want to run the other activity in a different thread to the UI.
If you're using MFC, look up "worker threads" in the help. That should get you started.
Be warned, though - multi-threaded programming isn't easy. There are lots of pitfalls - deadlocks, bad synchronisation etc. Don't try anything too fancy, just keep your code simple.
|
|
|
|
|
|
Hi...
How to change backgroungcolor and text color of CButton?(do not using seperate class)
can anyone please guide me?
Regards,
G.Paulraj
|
|
|
|
|
gnanapaul wrote: How to change backgroungcolor and text color of CButton
You have to owner draw the button to change the back ground color and text color
gnanapaul wrote: ?(do not using seperate class)
Handle the WM_DRAWITEM [^]message in the dialog and do the painting if the control id matches.
|
|
|
|
|
can you please explain briefly?
G.Paulraj
|
|
|
|