Ocupe / Projectors

A Blender add-on for simple projector creation and modification.
GNU General Public License v3.0
191 stars 16 forks source link

Adding lens distortion #5

Closed szat closed 2 years ago

szat commented 3 years ago

Great project!

I was wondering if it would be possible to add lens distortion to the model? Or is it already in it? I would also not mind coding a bit, maybe you could point to where I should make that addition?

Thanks!

Ocupe commented 3 years ago

Hey, Lens distortion is not implemented in the add-on at the moment. So far I had no use case for it. What kind of lens distortion do you have in mind? And would it be based on some real data or just an artistic tool (not judging)? If you could explain your use case and type(s) of lens distortion, I could tell you where to start and if I would be willing to merge it later-on.

szat commented 3 years ago

Hello, the idea would be to have a convenient simulation space for Camera Projector Display research. Think 3D from structured light or to align multiple projectors together.

Ocupe commented 3 years ago

Hey @szat, this sound interesting but at the moment I can't see how this fits into this add-on. If you could elaborate more what exactly you would like the add-on to do for you, I can maybe help you. I developed this add-on mainly for simple real-live projector setup tests. Everything that goes beyond that, I don't have the time to develop or maintain. But if you clarify what your goal is I can maybe give you some pointers.

szat commented 3 years ago

Practically, it would be nice to create a node, or extra fields in an existing node, with the usual radian and tangential distortion coefficients. If I change the value, the displayed image changes accordingly.

I don't mind coding it, but would be helpful if you could point there you think this should be added (in terms of code).

Ocupe commented 3 years ago

The add-on uses only the normal nodes that come with blender, there are no special nodes. I create the node-tree here: https://github.com/Ocupe/Projectors/blob/b4d939f828b494261c38dc0ac28257d119c624ed/projector.py#L86 A starting point would be that you create your own node within this function and then go from there (updating the values, controlling it via the ui ....). Just a heads up, I cannot guarantee that I will merge a possible merge request but feel free to fork or do whatever you like :). Good Luck!