EvergineTeam / Feedback

Feedback, feature requests, and bug reports for Evergine.
https://evergine.com
14 stars 1 forks source link

Orthographic view #84

Open BChapoulie opened 3 years ago

BChapoulie commented 3 years ago

Hello,

I've seen that on WaveEngine 2 I could have an orthographic view for the camera if we put the field of view to 0. Unfortunately, this behaviour doesn't exist in WaveEngine 3. In order to do so, I've seen that I can define my own projection matrix but I can't manage to figure this matrix out. I've used different variation of this: image

And yet nothing seem to work as a good orthogonal projection (my object is always distorded) : image

This is supposed to be a sphere.

Can you guide me through how to make it work? Thanks.

BChapoulie commented 3 years ago

Little update on my issue here. I've managed to have something that looks more like an orthographic view using this Matrix4x4.CreateOrthographic(2, 2 / _camera.ScreenViewport.AspectRatio, 0, 1000). However the skybox just appears as a circle when I do so (not using the whole viewport).

The sphere ressembles more to a circle: image

But the skybox is also a circle now: image

adamthole commented 2 years ago

I would also be interested in learning how to get an Orthographic view from an Evergine Camera3D object. Thanks!

madamc commented 2 years ago

in Evergine 2022.2.16.4, it appears that I'm able to successfully render the Camera3D with orthographic projection. @BChapoulie, it looks almost identical to what you have. When you instantiate the Camera3D, you simply need to set a custom projection on the Camera: cam3d.SetCustomProjection(Matrix4x4.CreateOrthographic(16f, 9f, 0, 1000f) With the project resolution currently set to 1280x720 (a 16:9 resolution, which matches up with the aspect ratio I set in the projection), it renders undistorted. evergineorthographic evergineorthographic2