Zooming camera?
Zooming camera?
Is there any way i can make my camera "zoom in" on an object? And if possible make it look like your looking through a scope?
rodger
That would be a use feature. Would it be possible to simply render from a second camera which is closer to whatever you want to look at to a viewport? Although moving a camera closer to the target would probably change the angles. Have you tried setting the camera's FOV to a number like 3.0f? that creates an effect like the camera zooming in. Please let us know if find a solution to this!
if you derive your own camera class then you can create an function like:Spartacus wrote:yea i already tried chaing fov... and it would be kinda complicated to shoot a camera out to zoom and then shoot it back 0.o kinda ? 0.o
Code: Select all
void MyCamera::UpdateZoom() {
if ( zooming_in )
this->setFOV ( this->getFOV() + 0.01f );
else if ( zooming_out )
this->setFOV ( this->getFOV() - 0.01f );
//bounds check
if ( this->getFOV() > 3.0f ) this->setFOV(3.0f);
else if ( this->getFOV() < NOMINAL_ZOOM) this->setFOV(NOMINAL_ZOOM);
}
check out the code from this thread http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=626 .. it should help you with setting up a derived camera class (somewhat )Spartacus wrote:Ok i got a basic camera class setup that is used to kinda like add on to camera stuff i dont belive its derived but.. its not working >.<
g_irr is an instance of the Irrlicht device. in the tutorials there is the lineSpartacus wrote:Well if you would check your messages you would know 0.o. Im having most problems getting the g_irr value to be "global" and the constructor is having lots of problems too :/
Code: Select all
IrrlichtDevice *device = createDevice(DT_SOFTWARE, dimension2d<s32>(512, 384), 16, false, false, 0);
Code: Select all
MyCam::MyCam() : CCameraSceneNode(device->getSceneManager()->getRootSceneNode(),device->getSceneManager(),-1){
//init the mycam variables
down = up = left = right = zoomin = zoomout = false; //nice syntax :)
}
Well I already knew what you just said and ive done it before and it didnt work their are like 20 errors and 40 warnings.
.... ect
Code: Select all
error C2512: 'ICameraSceneNode' : no appropriate default constructor available
error C2614: 'CMyCamera' : illegal member initialization: 'CCameraSceneNode' is not a base or member
error C2259: 'CMyCamera' : cannot instantiate abstract class due to following members:
warning C4259: 'const class irr::core::aabbox3d<float> &__thiscall irr::scene::ISceneNode::getBoundingBox(void) const' : pure virtual function was not defined
warning C4259: 'void __thiscall irr::scene::ISceneNode::render(void)' : pure virtual function was not defined
warning C4259: 'bool __thiscall irr::scene::ICameraSceneNode::isInputReceiverEnabled(void)' : pure virtual function was not defined
fatal error C1903: unable to recover from previous error(s); stopping compilation
virtual disaster
sounds like you are not setting up your camera class properly. were you able to try out the code i sent you? if you use that code and replace the variable 'grr' with your own pointer to the irrlicht device then it should compileSpartacus wrote:Well I already knew what you just said and ive done it before and it didnt work their are like 20 errors and 40 warnings.
.... ect