Moved camera...
Moved camera...
How to make in order to the camera moved forward to the left button of the mouse at the press?
smgr->addCameraSceneNodeMaya(0);
Allows the camera to be controlled using the mouse. Both mousebuttons + left-right movements are in/out or backward/forward.
But I think what your asking is how to get the IN vector of the camera then add it to its position. Im not sure how to do that yet, ill take a look ...
EDIT: Golly, this was easy with Genesis3D!
geXForm3d_GetIn(&cameramatrix, &in);
geVec3d_AddScaled(&cameratranslation, &in, movespeed);
/* this is essentially a 'standard' 4x4 transform matrix,
with the bottom row always 0,0,0,1
| AX, AY, AZ, Translation.X |
| BX, BY, BZ, Translation.Y |
| CX, CY, CZ, Translation.Z |
| 0, 0, 0, 1 |
*/
The in vector is (Genesis3D)
In.X = -Matrix.AZ;
In.Y = -Matrix.BZ;
In.Z = -Matrix.CZ;
Since my head is about to explode ill also ask a question which could be brain-dead simple. (so in the wrong forum, but hey)
In IrrLicht, how do you get the In vector from a matrix?
Allows the camera to be controlled using the mouse. Both mousebuttons + left-right movements are in/out or backward/forward.
But I think what your asking is how to get the IN vector of the camera then add it to its position. Im not sure how to do that yet, ill take a look ...
EDIT: Golly, this was easy with Genesis3D!
geXForm3d_GetIn(&cameramatrix, &in);
geVec3d_AddScaled(&cameratranslation, &in, movespeed);
/* this is essentially a 'standard' 4x4 transform matrix,
with the bottom row always 0,0,0,1
| AX, AY, AZ, Translation.X |
| BX, BY, BZ, Translation.Y |
| CX, CY, CZ, Translation.Z |
| 0, 0, 0, 1 |
*/
The in vector is (Genesis3D)
In.X = -Matrix.AZ;
In.Y = -Matrix.BZ;
In.Z = -Matrix.CZ;
Since my head is about to explode ill also ask a question which could be brain-dead simple. (so in the wrong forum, but hey)
In IrrLicht, how do you get the In vector from a matrix?
"When we looked at the relics of the precursors, we saw what heights civilization can attain.
When we looked at their ruins, we marked the danger of that height." -Keeper Annals
(Thief2: The Metal Age)
When we looked at their ruins, we marked the danger of that height." -Keeper Annals
(Thief2: The Metal Age)
It is an old piece of a code
One more variant
And then I do not know as to do(make)...
If there was getRotation() in degrees.
Code: Select all
core::vector3df vec;
vec = smgr->getActiveCamera()->getPosition();
vec += core::vector3df(5,0,5);
smgr->getActiveCamera()->setPosition(vec);
One more variant
Code: Select all
// get line of camera
core::vector3df start = global_camera->getPosition();
core::vector3df end = (global_camera->getTarget() - start);
end.normalize();
end = start + (end * global_camera->getFarValue());
core::line3d<f32> line(start, end);
If there was getRotation() in degrees.
LOL took me a while to figure out the In vector. Im rusty
Put that in your event reciever for your left-mouse button.
Hope this helps!
EDIT: BTW I just answered my own question too, it was fun!
EDIT2:
Look here too
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3708
Code: Select all
matrix4 cameramatrix = camera->getRelativeTransformation();
/*
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
*/
vector3df in( cameramatrix.M[8],
cameramatrix.M[9],
cameramatrix.M[10]);
vector3df pos = camera->getPosition();
pos += in;
camera->setPosition(pos);
Hope this helps!
EDIT: BTW I just answered my own question too, it was fun!
EDIT2:
Look here too
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3708
"When we looked at the relics of the precursors, we saw what heights civilization can attain.
When we looked at their ruins, we marked the danger of that height." -Keeper Annals
(Thief2: The Metal Age)
When we looked at their ruins, we marked the danger of that height." -Keeper Annals
(Thief2: The Metal Age)
basically the camera's Z axis is its front
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
Crucible of Stars
Crucible of Stars
basically the camera's Z axis is its front
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
Crucible of Stars
Crucible of Stars