Storing camera position
Storing camera position
I'm working on a project where I have 2 camera's, one is a static and the other one is the fps camera.
I managed to be able to switch bewteen the cameras but everytime I go back to the fps camera it returns to it's starting position.
I've been messing around with the get and set position() but I keep losing the camera's new position.
How do you do this? Where should I initialise my camera's? Is there a way to store the camera position and reaply it later?
I managed to be able to switch bewteen the cameras but everytime I go back to the fps camera it returns to it's starting position.
I've been messing around with the get and set position() but I keep losing the camera's new position.
How do you do this? Where should I initialise my camera's? Is there a way to store the camera position and reaply it later?
yeah I could, but right now, the player is just a camera floating around, you're suggesting I attach a node to the fps camera so I could just redirect the camera to the player-node's position?
It is a good workaround, i've been trying to find how the the addCameraSceneNodeFPS is build in the source because in it's construct they don't give it a position, they just add cameraspeed and such.
if you could give it a start position I could make that one variable and everytime the camera gets loaded I could make the start position my previous position , but I'll try your way first, if it works, I can move on :d
It is a good workaround, i've been trying to find how the the addCameraSceneNodeFPS is build in the source because in it's construct they don't give it a position, they just add cameraspeed and such.
if you could give it a start position I could make that one variable and everytime the camera gets loaded I could make the start position my previous position , but I'll try your way first, if it works, I can move on :d
err yeh thats what i meant hehehe i think you have a better idea of it than I doSuB wrote:yeah I could, but right now, the player is just a camera floating around, you're suggesting I attach a node to the fps camera so I could just redirect the camera to the player-node's position?
It is a good workaround, i've been trying to find how the the addCameraSceneNodeFPS is build in the source because in it's construct they don't give it a position, they just add cameraspeed and such.
if you could give it a start position I could make that one variable and everytime the camera gets loaded I could make the start position my previous position , but I'll try your way first, if it works, I can move on :d
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3651
This is a similar topic and I posted some of my code on the setPosition(getPosition) thing. Its not perfect but may help.
(camera switching I mean)
This is a similar topic and I posted some of my code on the setPosition(getPosition) thing. Its not perfect but may help.
(camera switching I mean)
"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)
Tnx everyobody, and allot of tnx go to Oz
seemed that the only thing I was missing was setActiveCamera and a little reorganising
I can roam around the level in the fps camera, when I hit a button the camera freezes and I have cursor control in my menus, I hit the button again and the menu's go away and I can continue roaming
SuB is very happy, tnx guys
seemed that the only thing I was missing was setActiveCamera and a little reorganising
I can roam around the level in the fps camera, when I hit a button the camera freezes and I have cursor control in my menus, I hit the button again and the menu's go away and I can continue roaming
SuB is very happy, tnx guys
kudos
Great! Im glad it was a help. The reason I did all that was just so I could toggle wireframe rendering, im coding another quadtree
Im a sucker for punishment, you could say
Im a sucker for punishment, you could say
"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)