# Torath

Member

8

117 Neutral

• Rank
Newbie
1. ## Quaternion rotation

Ah, I understand! Thanks haegarr (and SiCrane). I changed the code so I apply the newest rotation first then reapply the older rotations and it works beautifully! Thanks so much.
2. ## Quaternion rotation

Ah, the catch is I want the rotations to be independent. For example, the ship first rotates 90 degrees around the Y axis (yaw to the right), then moves in that direction for some amount of time, and finally as a later action it rotates 90 degrees around the Z axis (pitching the nose upwards). I'm basically trying to give the player the freedom to move/rotate the ship as if it were a real spaceship. ;)
3. ## Quaternion rotation

Hi, I'm working on a 3D space game built with C++ and DirectX. I've got a question about using quaternions for object rotation and I'm hoping someone might have an idea. Currently, the player ship's rotation is represented by a quaternion. The ship starts off level and facing directly straight forward (towards the positive Z axis). I create a quaternion based on the 3 axes (positive X to the right, Y is up, and Z is forward). If I want to apply a rotation to the ship, for example 90 degrees to the right, I can call D3DXQuaternionRotationAxis() to get a rotation quaternion. I then multiply that against the original rotation using D3DXQuaternionMultiply() and I get a new updated rotation where the ship is facing forward along the X axis (perfect!). The problem I have is in the next step: If I then want to make a second rotation of pitching the nose of the ship up (based on the current direction it's facing along the X axis), when I try to use the method described above I don't get the intended result. What happens instead is the ship indeed rotates, but as if it were still facing in it's original direction towards the Z axis. So instead of seeing the nose of the ship rotate up, I see the ship roll. Or to be more clear, I see a rotation around the X axis, rather than seeing a rotation around the Z axis. This is probably a very simple mistake, but for some reason I always have trouble wrapping my head around quaternion math. Any help is appreciated!
4. ## Rendering a space skybox

This looks very cool, I'm going to give it a try!
5. ## Rendering a space skybox

Thanks for the advice. I like the idea of using the scaling matrix to easily try different sizes.
6. ## Rendering a space skybox

Hi. I'm currently working on a small 3D space game built using C++ and DirectX 11. I've added in a skybox that has a nice mixture of stars for my background. Howevever, when I see it in game it never looks as sharp as the actual textures I've got. For example, the stars end up looking blocky instead of nice and crisp. Does anyone have tips for rendering a nice looking skybox? Oh, for reference, the sampler state I've set up for the pixel shader uses the D3D11_FILTER_MIN_MAG_MIP_LINEAR filter. Is this a good choice? Is there a better alternative? Thanks for any help!
7. ## Sleep() not reliable?

Ah, interesting! Thanks for the help everyone, I'll change my implementation based on this info.
8. ## Sleep() not reliable?

Hi everyone, I'm building a game engine from the ground up using C++ and DirectX. In my main game loop I am calling the function Sleep() each frame, but it doesn't consistently sleep for the time I specify. Instead of sleeping for 16ms for example, it will sleep for roughly 30ms. I tried a different implementation using a waitable timer (using the functions SetWaitableTimer() and WaitForSingleObject()) and I see similar behavior. The strange thing (and this might be a red herring) is I saw it work properly once while debugging the game in Visual Studio. However, when I run outside the debugger I get the behavior described above. Any ideas? Thanks for any help!