Jump to content
• Advertisement

# domin

Member

70

130 Neutral

• Rank
Member
1. ## Problem with combined rotations

I'm using quaternions internally, but the rotations are exposed as radians to simplify vizualization of the problem: (X axis, Y axis, Z axis). No mater what method is used the combined rotation of the camera and the player still causes this problem. Maybe I'm not completely clear in the first post - the rotation of the player and the camera are not multiplied together - they are completely independent - just simple Y axis rotations...
2. ## Problem with combined rotations

Hi all - I have simple problem with combined rotations. The situation looks like this: Lets assume that everything is done in 2d. The camera is right above the player and is looking down at him. Now, I want to rotate the player according to the mouse cursor, so he is alway looking 'at the mouse cursor'. This is simple - good, old atan2 (player is always in the center of the screen): float f1 = Input.mousePosition.x - Screen.width / 2.0f; float f2 = Input.mousePosition.y - Screen.height / 2.0f; float angle = Mathf.Atan2(f1, f2); So, rotation of the player is: (0.0f, angle, 0.0f) and its works fine. But now I want to add camera rotation based on the same rules, so rotation for the camera should be: (Mathf.PI / 2.0f, angle, 0.0f) and here the problem appears... It looks like the camera is rotating faster that the player, or the player is slower that the camera... I suppose that is an illussion from combining two rotations together (for the camera and the player), but I can't find a solution to solve this problem. Please, help
3. ## Axis Angle to Quaternion (when angle = 0)

Hi all! I'm little confused - to convert axis and angle to quaternion, we can use this simple formula: qx = ax * sin(angle/2) qy = ay * sin(angle/2) qz = az * sin(angle/2) qw = cos(angle/2) But, when angle = 0 the result will be always 0, 0, 0, 1, no matter how axis looks. Is there any solution to compute quaternion with 0 angle? Thanks for any suggestions!
4. ## Converting a 3DMax quaternion to a OpenGL quaternion

Thanks for a tip, but unfortunately i'm not using IGame / 3DXI interfaces...
5. ## Converting a 3DMax quaternion to a OpenGL quaternion

Please help me with this topic - i have already tried to exchange z/y axes, change rotation sign - nothing works...
6. ## c++ - Converting string to regular function

I want to use it in DirectX FX files - each FX file (as a shader container) needs special processing (code) and I want to put that code in the FX file as a string and at runtime get that string and execute it just before starting the effect.
7. ## c++ - Converting string to regular function

Hi all, is there any way to convert standart text variable (for example: char Text[1024]) to function? Of course assuming that text variable contains full function code. Or, if text variable contains function code how to call it? Thanks for any suggestions!
8. ## DirectInput8 and MFC problem

Yep, for the top level window everything works fine. Thanks for your time!
9. ## DirectInput8 and MFC problem

According to Spy++ the handle belongs to window that has WS_CHILDWINDOW in styles. Is it important?
10. ## DirectInput8 and MFC problem

The value is: HWnd = 0x000f08ea {unused=-267535699 } The reason for using DI or XI is simple - my engine must run on XB360 HW.
11. ## DirectInput8 and MFC problem

Thanks, yes, I know, DI is not a best solution here, but I just want to put my 3d engine (without any modifications (leaving window creation to MFC of course)) into MFC to create a level editor... But I don't understand what is wrong with my _HWnd... I get it using CView::GetSafeHwnd(). It is ok for D3D cration, but not ok for DI? Strange...
12. ## DirectInput8 and MFC problem

Hi all, I try to use DI keyboard in MFC app, but I have problems with SetCooperativeLevel() method. In my class (CView descendant), in OnInitialUpdate() I have following DI init code: HR = DirectInput8Create(_HInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&_DirectInput, NULL); if (FAILED(HR)) { strcpy(OutputText, "DirectInput8Create() - FAILED"); goto __Failure; } HR = _DirectInput->CreateDevice(GUID_SysKeyboard, &_KeyboardDevice, 0); if (FAILED(HR)) { strcpy(OutputText, "Keyboard Device: CreateDevice() - FAILED"); goto __Failure; } HR = _KeyboardDevice->SetDataFormat(&c_dfDIKeyboard); if (FAILED(HR)) { strcpy(OutputText, "Keyboard Device: SetDataFormat() - FAILED"); goto __Failure; } HR = _KeyboardDevice->SetCooperativeLevel(_HWnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE); if (FAILED(HR)) { strcpy(OutputText, "Keyboard Device: SetCooperativeLevel() - FAILED"); goto __Failure; } HR = _KeyboardDevice->Acquire(); if (FAILED(HR)) { strcpy(OutputText, "Keyboard Device: Acquire() - FAILED"); goto __Failure; } The line: HR = _KeyboardDevice->SetCooperativeLevel(_HWnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE); returns E_HANDLE no matter what coop. level is set... Any idea where is the problem? Thanks.
13. ## Removing fixed pipe dependencies

Thanks for all the points! Maybe something else can be added?
14. ## Removing fixed pipe dependencies

Hello. I have written complete 3d engine, which I use for my own, home projects. It is completely based on dx9, supports sound, audio and video streams, collisions, etc. But now I want to start porting this engine to dx10. I want to do this in two steps. First, I want to remove all fixed pipe depenedencies from my existing engine. So if somebody can give me complete list of d3d9 (and d3dx9) functions, that even in minimal way rely on fixed pipe it woluld by great! Thanks for any sugestions!
15. ## Playstation 2 - 3d engine

Hi all. I'm looking for cheap, stable 3d engine for ps2. Could somebody recommend something? Thanks for any sugestions.
• Advertisement
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!