Skip to main content
gamedev.net
🔒 Locked

Problem with Camera

Started by tri-thanatos Jan 14, 2004 at 9:38 AM 1 replies 300+ views
Original Post
tri-thanatos
tri-thanatos
ok, I am starting a basic camera class, that just has the ability to move forward/backward,left/right in D3D(since I am new to d3d, thought a camera class would be good experience), everything works right from the stand point of moving my pos, however, how should I move my lookat point to be in relation to the pos?

// here are the vectors values at the beginning

// vPos = (0,0,0)

// vView = (0,0,1)

// vRight = (1,0,0)

// vUp = (0,1,0)


void ICamera::move(unsigned int direction,float fspeed)
{

if(direction == MV_FORWARD)
{

  vPos += vView * fspeed;
}
if(direction == MV_BACK)
{
  vPos -= vView * fspeed;
}
if(direction == MV_RIGHT)
{
  vPos += vRight * fspeed;
}
if(direction == MV_LEFT)
{
  vPos -= vRight * fspeed;
}
};

now how should I modify the view point, as I dont understand if in direct X the view point is a direction, or is an actual point and how I should modify it when I move left/right. thanks, thanatos
tri-thanatos
tri-thanatos
well, I have tried that, as in if I move in a direction, I add the same thing to my view vector, however, it still messes up.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.