ogre3d

Pow implementation for double

社会主义新天地 提交于 2019-12-05 02:04:35
问题 I am developing a code that will be used for motion control and I am having a issue with the pow function. I am using VS2010 as IDE. Here is my issue: I have: double p = 100.0000; double d = 1000.0000; t1 = pow((p/(8.0000*d),1.00/4.000); When evaluating this last function, I don't get the better approximation as result. I am getting a 7 decimal digits correct, and the consequent digits are all trash. I am guessing that pow function only casts any input variable as float and proceds with

Pow implementation for double

China☆狼群 提交于 2019-12-03 20:21:09
I am developing a code that will be used for motion control and I am having a issue with the pow function. I am using VS2010 as IDE. Here is my issue: I have: double p = 100.0000; double d = 1000.0000; t1 = pow((p/(8.0000*d),1.00/4.000); When evaluating this last function, I don't get the better approximation as result. I am getting a 7 decimal digits correct, and the consequent digits are all trash. I am guessing that pow function only casts any input variable as float and proceds with calculation. Am I right? If so, is there any code I can get "inspired" with to reimplement pow for a better

How to use SDL with OGRE?

醉酒当歌 提交于 2019-12-01 17:50:59
When I go to use OGRE with SDL (as described in this article ), I seem to be having trouble with a second window that appears behind my main render window. Basically, the code I'm using is this: SDL_init(SDL_INIT_VIDEO); SDL_Surface *screen = SDL_SetVideoMode(640, 480, 0, SDL_OPENGL); Ogre::Root *root = new Ogre::Root(); root->restoreConfig(); root->initialise(false); Ogre::NameValuePairList windowSettings; windowSettings["currentGLContext"] = Ogre::String("True"); Ogre::RenderWindow *window = root->createRenderWindow("MainRenderWindow", 640, 480, false, &windowSettings); window->setVisible

'Difference' between two quaternions

穿精又带淫゛_ 提交于 2019-11-28 21:18:04
I'm working in Ogre, but it's a general quaternion problem. I have an object, to which I apply a rotation quaternion Q1 initially. Later, I want to make it as if I initially rotated the object by a different quaternion Q2. How do I calculate the quaternion which will take the object, already rotated by Q1, and align it as if all I did was apply Q2 to the initial/default orientation? I was looking at (s)lerping, but I am not sure if this only valid on orientations rather than rotations ? It sounds like you want the inverse of Q1 times Q2. Transforming by the inverse of Q1 will rotate the object