Page 1 of 1

CryEngine 5.4 - How to create orbit camera with C++

Posted: Sun Jan 21, 2018 2:45 pm
by HDN
I tried to figure out a way to switch from the current third person camera (with aiming style) to orbit style.
First, I tried to remove the aiming style by comment out these 2 lines: this and this
So now I can turn the camera without turning the character. But I wonder if the class CCameraComponent has orbit implement in it (it should orbit the parent entity). I found an article that implemented orbit camera for CryEngine 5.2, if the class CCameraComponent hasn't implemented orbit, I guess I'll have to use this.

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Sun Jan 21, 2018 4:02 pm
by fury22uk
I guess you will need to read about https://en.wikipedia.org/wiki/Quaternion this will help you a lot :)

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Mon Jan 22, 2018 3:02 am
by HDN
Thank fury22uk :) I should have read that article long before, but never too late to read.

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Mon Jan 22, 2018 3:36 am
by fury22uk
Also, get your hands on the code of Rolling Ball template. I think they use orbit cam there

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Mon Jan 22, 2018 4:16 am
by HDN
Thank fury22uk, so this is the code I need all along. Now I just need to tweak a bit to fit my need.

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Mon Jan 22, 2018 6:32 am
by ivanhawkes
You might also want to take a look at the Action RPG camera I have made for my project. It's an orbit camera which can freely rotate around the player / character, regardless of their movement direction.

It's got a bunch of nice enhancements too, like variations on how the tilt works, zooming in and out using the middle mouse button, variable zoom range steps, simple collision detection, cvars all set up to work with it, etc.

It's obviously a bit more complex than the other examples, so maybe look at them first and then see what a fully fledged implementation might look like. It's made to use with a camera manager, and can switch to a first person view if set up with that manager.

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Mon Jan 22, 2018 11:23 am
by HDN
Hi ivanhawkes, thanks for sharing it :)
I found another interesting article from Ivan Hawkes (ivanhawkes) himself: Matrices, Vectors, Quaternions and CryEngine 3.

Re: CryEngine 5.4 - How to create orbit camera with C++

Posted: Tue Jan 23, 2018 6:35 am
by ivanhawkes
I wrote that back in the back when I was trying to learn how to use the quaternions and vectors. It's like a quick-start guide to help you understand it, without all the waffle the math nerds go on about when they teach it :D