Angle Based Camera

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
ceisnaugle

Angle Based Camera

Post 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
jugurdzija
Posts: 26
Joined: Thu Feb 05, 2004 10:58 pm

?

Post by jugurdzija »

......?
ceisnaugle

Angle Based Camera

Post 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
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Re: Angle Based Camera

Post 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){
}
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post 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.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post 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
ceisnaugle

Angle Based Camera

Post 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
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Re: Angle Based Camera

Post 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.
ceisnaugle

Working

Post 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
Post Reply