Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Nov 2010
Offline Last Active Aug 25 2012 04:38 PM

Posts I've Made

In Topic: Memory conservation for tiled textures using Ogre 3D

18 August 2012 - 03:57 PM

I solved this issue by using PVRTC compression since pngs were being fully decompressed on the hardware.

In Topic: Best data structure for storing pointers with indexing by 3D points

29 March 2012 - 08:12 PM

That's probably a good option. Thanks for the input.

Something I should have mentioned previously is that the points used will form a thin contiguous surface wrapped around 3D terrain and structures.

In Topic: Potential Problems with Perspective and LookAt Matrix

03 September 2011 - 07:05 PM

Another update:

I reordered the cross product between the up and zAxis. As a result, I start facing the correct direction with up in the correct direction as well. Yaw pitch and roll are now inverted, so if I try to look left, I look right instead. My forward, backward, left and right movements relative to the camera are correct unless i angle the camera down. When I angle the camera down these movements will reverse after a certain threshold.

This is my revised look at function:

MatrixLookAt (Matrix& dest, Vector3D& eye, Vector3D& at, Vector3D& up)
	Vector3D xAxis;
	Vector3D yAxis;
	Vector3D zAxis;

	Vector3DSubtract (eye, at, zAxis);
	zAxis.Normalize ();

	Vector3DCross (up, zAxis, xAxis);
	xAxis.Normalize ();

	Vector3DCross (zAxis, xAxis, yAxis);

Any help would be much appreciated. I've been stuck on this problem for far too long now.

Edit: Negating the yaw and pitch values gives correct camera rotations, however movement of the camera still has problems when you angle the camera away from the z axis.

In Topic: Potential Problems with Perspective and LookAt Matrix

03 September 2011 - 03:43 AM

I was using the 90 degree around x idea because the conversion from the right handed system that I got my matrix algorithms from, to my right handed system (where z is up) is a 90 degree clockwise rotation around the x axis. However, I am not currently using that.

The up vector I am passing in is [0, 0, 1].


I'm still having issues, just slightly different ones.

I have rewritten my yaw pitch and roll function based on the relation of yaw pitch and roll to my coordinate system instead of rotating the matrix from the other system.

As a result, up is now down and yaw pitch and roll is working fine if and only if you remain in the up is down orientation. In addition, movement to the right results in movement to the left and vice versa regardless of what up down orientation you place yourself into. Also, you now start facing the correct direction of forward (positive y).

Here is the yaw pitch and roll function that I am using. There are some pretty obvious optimizations to it that I'll implement once things are working properly.

MatrixRotationYawPitchRoll (Matrix& dest, float32 yaw, float32 pitch, float32 roll)
	Matrix yawMatrix;
	Matrix pitchMatrix;
	Matrix rollMatrix;

	MatrixRotationZ (yawMatrix, yaw);
	MatrixRotationX (pitchMatrix, pitch);
	MatrixRotationY (rollMatrix, roll);

	dest.Identity ();
	dest *= rollMatrix;
	dest *= pitchMatrix;
	dest *= yawMatrix;

In Topic: Question about D3DXVec3TransformCoord

12 April 2011 - 11:26 PM

The problem was that I had assumed DirectX used column vectors instead of row vectors. So that takes care of that problem. Thanks!