f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Add support for ortographic projection

Open mrdeveloperdude opened this issue 1 year ago • 8 comments

As a user of f3d I would like to see support for orthographic projection.

Currently only perspective projection is supported. My use case is that I will render thumbnails of CAD models and it is customary to use orthographic projection in CAD.

It can possibly be faked by moving the camera far away and setting a low camera angle. Possible pitfalls of this hack is floating point precision problems, poor z-buffer dynamic range use and more.

mrdeveloperdude avatar Dec 10 '23 19:12 mrdeveloperdude

Indeed a nice addition, shouldnt be too hard to add.

mwestphal avatar Dec 10 '23 19:12 mwestphal

For reference if someone wants to give it a try: https://vtk.org/doc/nightly/html/classvtkCamera.html#a87b276a44eb1817aa388c89dc9becfc5

Obviously we need an option to toggle it.

Meakk avatar Dec 10 '23 19:12 Meakk

I'd like to work on this as my first issue. I'm trying to write a simple Vulkan Engine as a hobby project and would love to work on f3d as well to learn more about graphics systems going forward!

aemreaydin avatar Dec 12 '23 04:12 aemreaydin

Hi @aemreaydin !

You are very welcome! We have been discussing this issue on discord, did you join already ?

https://discord.f3d.app

mwestphal avatar Dec 12 '23 07:12 mwestphal

There's a draft by @lknknm done here #942 if you want to take over.

Meakk avatar Dec 12 '23 21:12 Meakk

@kidharb so do you wanna try your hand at this one ?

mwestphal avatar Jan 27 '24 11:01 mwestphal

Yes, I'm just not sure regarding how the baselines work. So I've been trying to run the ctests locally which has led me down a path of learning cmake. Should I just push the code, which is just aemreaydin code?

kidharb avatar Jan 27 '24 14:01 kidharb

As you prefer, let me know if you need any help understanding how it works.

mwestphal avatar Jan 27 '24 14:01 mwestphal

Partially addresed by #1235

mwestphal avatar Mar 15 '24 18:03 mwestphal

Still need a command line option, are you will to add it @kidharb ?

mwestphal avatar Mar 15 '24 18:03 mwestphal

Fixed by #1315

mwestphal avatar Mar 17 '24 16:03 mwestphal