Hi @ll,
i created a scene with an orthogonal camera (thanks to saigumi), everything worked fine. Now i want to move that camera using the keyboard, but my app is crashing right from the start (illegal page).
When i use a normal camera node, everything is allright; my movement code is straight out of tutorial 4. When changing back to orthogonal projection, im getting this crash again.
Perhaps someone can help me? Thx
How to move an orthogonal camera?
Ah... yeah.
First, you can't use any of the Extra cameras that Niko has. These are set up for non-ortho movement.
I haven't figured out the intricacies of the camera movement yet after playing with it for 2 weeks. So, I did some codepath chopping and instead of moving the camera, I found it 1000 times easier to move the world and leave the camera projection matrix alone.
First, you can't use any of the Extra cameras that Niko has. These are set up for non-ortho movement.
I haven't figured out the intricacies of the camera movement yet after playing with it for 2 weeks. So, I did some codepath chopping and instead of moving the camera, I found it 1000 times easier to move the world and leave the camera projection matrix alone.
Crud, how do I do this again?
Im using an ICameraSceneNode (app crashes at start):First, you can't use any of the Extra cameras that Niko has. These are set up for non-ortho movement.
Code: Select all
irr::scene::ICameraSceneNode* camera = smgr->addCameraSceneNode(0,irr::core::vector3df(-10.0f, 10.0f, -15.0f),irr::core::vector3df(0,0,0));
irr::core::matrix4 MyMatrix;
MyMatrix.buildProjectionMatrixOrthoLH(200.0f,200.0f,200.0f,-200.0f);
camera->setProjectionMatrix(MyMatrix);
Its running fine if i
a) dont use the movement code from tutorial 4 or
b) replace the above code with just a simpe camera node:
Code: Select all
camera = smgr->addCameraSceneNode();
I dont know what to do now :/
Well, I'm not sure what you mean by movement code from Tutorial 4. The only movement I see is to move a Node that has the block attached, the camera still uses smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
As far as why, it's crashing... that's unexpected. When trying to use the FPSCamera everything just looks funky after moving or rotating the camera. (Like I said in the howto, rotating the camera gives surpring effects)
The only thing I can think of is that your ortho matrix looks huge. Try a smaller set first to see if it crashes.
As far as why, it's crashing... that's unexpected. When trying to use the FPSCamera everything just looks funky after moving or rotating the camera. (Like I said in the howto, rotating the camera gives surpring effects)
The only thing I can think of is that your ortho matrix looks huge. Try a smaller set first to see if it crashes.
Crud, how do I do this again?
I used the node-movement from tutorial 4 and applied it to my ICameraSceneNode. I didnt use the fps or maya camera. When using normal projection, the camera works fine and moves as it should.
I tried it for fun with the FPS camera, and it worked without errors or funky looks o.O No problems there for me (just moving).
I tried to change the values as you suggested, the app started without errors (happened before, it seems to be random?!), but when i pressed the W button to move the camera up, it crashed again... there the app is crashing every time... if not at startup....
I tried it for fun with the FPS camera, and it worked without errors or funky looks o.O No problems there for me (just moving).
I tried to change the values as you suggested, the app started without errors (happened before, it seems to be random?!), but when i pressed the W button to move the camera up, it crashed again... there the app is crashing every time... if not at startup....