Is there a bug in OgreMath?

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
myStupidNickname
Gnoblar
Posts: 13
Joined: Mon Jun 27, 2005 12:43 pm

Is there a bug in OgreMath?

Post by myStupidNickname »

I've look all over the forums and I can't find anything on this. I'm having a problem with the trig functions on OgreMath.

Code: Select all

Real someReal = 0.999903;
Radian someRadian = Math::ACos(someReal);
The expected result is that someRadian would equal 0.0139568 but I keep getting 0.799663 which is what I would get if I took the inverse cosine of a degree value(before everyone races to load Windows Calculator :D ) . I can't figure out why since the way I read the code for Math::ACos is that it uses math.h's acos(i tested, this does return radians) and then uses the result to construct an instance of a Radian. It may be a problem with the Radian code(though I don't see a problem in the line of code in the Radian constructor) since I get the same result if I copy the Math::ACos code into mine.

Has anyone ever encountered this problem before? I am using Code::Blocks with the VC++ Toolkit 2003 version 1-0-2 of Ogre. I also encountered the same problem with gcc and Dev-Cpp. Thanks!
myStupidNickname
Gnoblar
Posts: 13
Joined: Mon Jun 27, 2005 12:43 pm

Post by myStupidNickname »

Oh, and I'm making a MMORPG that will be WAY better than Everquest...just kidding, its my first time posting here and I thought I was supposed to say that.
User avatar
BlasterN
Gnome
Posts: 378
Joined: Thu Mar 24, 2005 1:07 am
Location: Spain
Contact:

Post by BlasterN »

The second post is not needed.

see that.
Ogre::Radian::valueRadians()

Code: Select all

Real someReal = 0.999903; 
Radian someRadian = Math::ACos(someReal); 
someRadian.valueRadians(); // give the real value in radians
Works:
MapToMesh | Bengine B9 @ www.sourceforge.net/projects/maptoogremesh/
3DWorldStudio exporter@ www.blastern.info
myStupidNickname
Gnoblar
Posts: 13
Joined: Mon Jun 27, 2005 12:43 pm

Post by myStupidNickname »

Thanks BlasterN. Now I know my problem is not Ogre's interpretation of Radians but my interpretation of trigonometry(which is not surprising). And the second was kind of needed if only because I suffer from the delusion that I'm funny.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

myStupidNickname wrote:Oh, and I'm making a MMORPG that will be WAY better than Everquest...just kidding, its my first time posting here and I thought I was supposed to say that.
Hey, Welcome to Ogre! :)
I find it funny :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
LordMyth
Gremlin
Posts: 181
Joined: Thu Jan 06, 2005 10:19 pm
Location: Belgium
Contact:

Post by LordMyth »

We have been teaching bad habits to the people... Maybe we should put some 'Making an MMORPG is NOT required! Everybody will be taken serious.' on the forum's front page.
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
myStupidNickname
Gnoblar
Posts: 13
Joined: Mon Jun 27, 2005 12:43 pm

Post by myStupidNickname »

Since I'm not actually making one, I actually feel a little left out. It's like maybe the other newbies know something I don't or maybe there's a wiki entry I skipped over. :wink:
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

myStupidNickname wrote:It's like maybe the other newbies know something I don't(...)
I think it's the other way around. :P

Edit: Oh yeah, you did miss, not a wiki entry, but this fantastic tool... Damn, temas closed his blog. He once had a nice one-click MMPORG generator tool for Ogre. :wink:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

You mean this ? :

Image

8)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
DaCracker
Gremlin
Posts: 192
Joined: Thu Jan 27, 2005 9:57 am
Location: Sweden
Contact:

Post by DaCracker »

May I have a copy of the generator? :)
Post Reply