Camera lookat

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Lupo
Posts: 76
Joined: Wed Sep 09, 2009 6:21 pm
Location: Montevideo, Uruguay

Camera lookat

Post by Lupo »

Hi,

For those Math gifted/talented people in the forum :) (you know who you are ;) )

Its a way to have a zgelibrary function to mimic/clone the GLU Camera LookAt ?

Something like Lookat( x, y, z) and then change the rotations of the camera to correctly look at that position/model ?

Thanks in advance,
Lupo

PS Bring the Quaternions!!!
Close, but not there yet.
User avatar
Lupo
Posts: 76
Joined: Wed Sep 09, 2009 6:21 pm
Location: Montevideo, Uruguay

Thinking a bit

Post by Lupo »

Maybe its better to think in some kind of camera component/behaviour?
Like:
- Follow that model.
- First Person
- Overtheshoulder
- Panoramic
Close, but not there yet.
User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Lupo,

You said it .. bring on the quaternions, you really need them for a gluLookAt type of function. However, when your game has a constant up axis, the math is actually very easy.

1st / 3rd person cameras I personally see as a scripting job instead of a generic component, as every game requires a ( slightly ) different implementation. A camera component on the other hand is one of the first things I requested about two years ago when first starting out with ZGE :wink:

*Although with the recently added OnBeginRenderPass it has become very easy to implement your own camera management system.

K
User avatar
Lupo
Posts: 76
Joined: Wed Sep 09, 2009 6:21 pm
Location: Montevideo, Uruguay

Camera

Post by Lupo »

Thanks Kjell !

Any chance of the code snippet for constant up axis version?

:)
Close, but not there yet.
User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

8)

Here you go ~

K
Attachments
Look-At.zgeproj
(1.41 KiB) Downloaded 607 times
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

Now that code has got to go in tips and tricks. :shock:
User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Post by diki »

most definitely :)
Post Reply