Page 1 of 1

Angle Based Camera

Posted: Thu Feb 05, 2004 11:27 pm
by ceisnaugle
Has anyone developed an angle based camera vs a LookAT based. Also has anyone had success in inhereting something like "ICameraSceneNode" in your app and creating a new camera with it?

ie

class CCamera : scene::ICameraSceneNode
{
...
}

Basically looking for some examples of custom First Person Camera code.

Thanks

Chris Eisnaugle

?

Posted: Thu Feb 05, 2004 11:35 pm
by jugurdzija
......?

Angle Based Camera

Posted: Fri Feb 06, 2004 3:36 am
by ceisnaugle
Angle based as in a camera that used angles to represent YAW, PITCH, ROLL and these are then converted to a new view matrix if the camera changes not a new LookAT point.

As for Inheretence, I was thinking of just taking "ICameraSceneNode" and making a custom camera but there are a lot of issues with teh various methods, namespaces, etc. Wondered if anyone had taken this on and tried it?

Thanks,

Chris Eisnaugle

Re: Angle Based Camera

Posted: Fri Feb 06, 2004 5:23 am
by rt
ceisnaugle wrote: class CCamera : scene::ICameraSceneNode
{
...
}
i derived my own camera class. the only problem i had was figuring out that the constructor needed to look like this:

Code: Select all

CurlingCam::CurlingCam() : CCameraSceneNode(smgr->getRootSceneNode(),smgr,-1){
}

Posted: Fri Feb 06, 2004 5:24 pm
by [dx/x]=HUNT3R
I just commented out the FPS camera code and replaced with mine, then recompiled the engine. If you're interested, check out my modified Irrlicht v0.4.1 source on my Supa G downloads page.

Posted: Fri Feb 06, 2004 5:25 pm
by [dx/x]=HUNT3R
I just commented out the FPS camera code and replaced it with mine, then recompiled the engine. If you're interested, check out my modified Irrlicht v0.4.1 source on my Supa G downloads page.

OOPs DOubLe pOSt

Angle Based Camera

Posted: Fri Feb 06, 2004 6:01 pm
by ceisnaugle
Was actually hoping to do it without adding new code to the engine itself so I don't get out of sync with what Niko is doing.

Was trying to figure out if I could just create a pointer to a CCAmeraSceneNode and although its a stationary camera use it to move around with my own FPS code. It works reasonably well except when I move backwards the screen flashes horribley like the LookAT point is wrong then corrects itself over ande over, but yet its code i've used forever and it only happens going backwards.

The other thing and don't know if anyone has corrected is during looking up and down, rotating etc. There is a warping effect on all polygons. The lines that should stay perpindicular are stretching with the top moving towads the screen and the bottom moving away when you look up, and vice versa when you look down. This is normall an issue when rotating around the UP Vector ala a space sim vs the Y Axis for a FPS. I havent dug into Niko's code enough to see what he does here yet.

Also was looking but could not find a way to set the View matrix, I can retrieve it but cannot set it unless I am missing something.

C

Re: Angle Based Camera

Posted: Sun Feb 08, 2004 12:33 am
by rt
ceisnaugle wrote:It works reasonably well except when I move backwards the screen flashes horribley like the LookAT point is wrong then corrects itself over ande over, but yet its code i've used forever and it only happens going backwards.
i had a problem that sounds like that.. i resolved it by calling camera->updateAbsolutePosition() right after setting it's position.

Working

Posted: Sun Feb 08, 2004 3:31 am
by ceisnaugle
Got it all working, had forgot to setTarget when backing up.

Still need to figure out the warping effect when looking up and down, lines shuould stay parralel and Perpindicular

C