xboxscene.org forums

Author Topic: 3d Math Stuff  (Read 128 times)

SHiZNO

  • Archived User
  • Sr. Member
  • *
  • Posts: 287
3d Math Stuff
« on: April 17, 2003, 10:08:00 PM »

hold on
Logged

SHiZNO

  • Archived User
  • Sr. Member
  • *
  • Posts: 287
3d Math Stuff
« Reply #1 on: April 17, 2003, 10:31:00 PM »

have a look a the D3DXMatrix* functions...
Logged

knepley

  • Archived User
  • Jr. Member
  • *
  • Posts: 57
3d Math Stuff
« Reply #2 on: April 17, 2003, 10:37:00 PM »

you looking to trace a vectors path in 3d space? given the pitch and yaw of the vector, you can figure it out using spherical coordinates. I used a vector calculus book to figure them out but they should be in a good geometry text too.
Logged

ghost gamer

  • Archived User
  • Newbie
  • *
  • Posts: 7
3d Math Stuff
« Reply #3 on: April 23, 2003, 11:35:00 AM »

well im no help with the rotation but...

the cos of an angle can be represented by x
and sin .... y
like you already said.

z is just z.  there is no trig funtion that can be sub. for it

im not ezaclty sure what your trying to do but like someone else already said, you might want to check out spherical.. but maybe even cyclendrical might be worth checking out.  maybe even polar?
Logged

lubby

  • Archived User
  • Newbie
  • *
  • Posts: 10
3d Math Stuff
« Reply #4 on: April 27, 2003, 12:55:00 AM »

dude, if you want to use euler angles do it like this...

float heading = DegreeToRadian(your_heading);
float pitch = DegreeToRadian(your_pitch);

pos
  • = ( pos
  • + cosf(pitch) * distance * sin(heading) );
    pos[y] = ( pos[y] + sinf(pitch)  * distance);
    pos[z] = ( pos[z] + cosf(pitch) * distance * cos(heading) );

    dont forget use a time scale on distance or else your movements going to be dependant on framerate.

    enjoy :-)
Logged