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
Angle Based Camera
Angle Based Camera
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
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
i derived my own camera class. the only problem i had was figuring out that the constructor needed to look like this:ceisnaugle wrote: class CCamera : scene::ICameraSceneNode
{
...
}
Code: Select all
CurlingCam::CurlingCam() : CCameraSceneNode(smgr->getRootSceneNode(),smgr,-1){
}
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
Angle Based Camera
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
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
i had a problem that sounds like that.. i resolved it by calling camera->updateAbsolutePosition() right after setting it's position.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.