Smooth FPS camera

A forum to store posts deemed exceptionally wise and useful
oconv
Posts: 14
Joined: Fri Dec 17, 2004 2:12 pm

Post by oconv »

yeah, much smoother :D

thanks alot :lol:
Guest

Post by Guest »

isn't

Code: Select all

  if (cursorpos.X < 0.5f || cursorpos.X > 0.5f ||
    cursorpos.Y < 0.5f || cursorpos.Y > 0.5f)
the same as

Code: Select all

  if (cursorpos.X != 0.5f || cursorpos.Y != 0.5f)
if so, and I'm not completly dumb, why not use the other option?
Guest

Post by Guest »

why dont u just test out ur option and let us know of any differnece
StickyBit
Posts: 94
Joined: Mon Jul 05, 2004 3:40 am
Location: Sønderup, Denmark
Contact:

Post by StickyBit »

FYI: I´ve just used Warui´s hack on ver. 0.8 - and it still does magic. :-)

Regards Stickybit
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

it sure does, dunno why it hasn't been made official.
Guest

Post by Guest »

Anonymous wrote:isn't

Code: Select all

  if (cursorpos.X < 0.5f || cursorpos.X > 0.5f ||
    cursorpos.Y < 0.5f || cursorpos.Y > 0.5f)
the same as

Code: Select all

  if (cursorpos.X != 0.5f || cursorpos.Y != 0.5f)
if so, and I'm not completly dumb, why not use the other option?
Yes, I saw the same thing. That would be a better way of checking cursorpos.
Wintran
Posts: 2
Joined: Sun Mar 13, 2005 9:49 pm
Location: Sweden

Post by Wintran »

You can use this code to set the fov using degrees instead of radians:

Code: Select all

3.14159f / (180f / (180 - degrees))
Simply replace "degrees" with the desired number of degrees (1-180) that you want your fov to be.

Regarding the smooth mouse code, I would also love to see this or a similar code being implemented to the official game engine. It is a requirement for any serious 3D app using the mouse for camera movements.
yes

Post by yes »

sounds like it is using radians instead of degrees. radians are fractions of pi.

1.4 rads is very close to 90 degrees.
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Post by Myth »

In case anyone doesn't understand how to use it... use this funtion.
Thanks to wintran.

Code: Select all

// Myth
void setFOVdegrees(ISceneNode *cam, const float degrees)
{
 cam->setFOV(3.14159f  / ( 180.0f / (180 - degrees)));
 return;
}
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Post by Myth »

It gives sqrt: DOMAIN EXPECTION ERROR at runtime.

Any idea why?
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
Post Reply