Project (move and scale) curves in perspective view on a surface

Hi all,

I would like to project curves (circles from a sampled image) onto a curved surface from a viewers point.
This means I would get an illusion of a 2D image from a specific point and this means that the projected geometry would have to scale proportional to the depth.

Something like this:

I also made a sketch how this would look in my case:


I found some scripts from Pascal (ProjectView, MoveProject) which i thought would work, but they did not produce the result i wanted. I understand that camera lens length also has to be taken into account.

I would probably be able to make a grasshopper file where the image gets scaled and moved acording to the camera lines i get with F6 in rhino, but i don’t know how to take the result of the intersection between the move and the target surface.

Is there a rhino script or a way in grasshopper to do this?

Something like this? (Hereafter to be abbreviated SLT?) BTW, I don’t know if we’re still having problems with images being transferred using the Image Mapper. I guess we’ll find out…

perspective projection.gh (274.5 KB)

2 Likes

And here some mesh projecting on mesh… nothing complex.
With some c# code you can get frustum camera info of current active viewport.

2019-01-19%2017_38_54-Window


projection.gh (117.8 KB)

5 Likes

Hi Riccardo, thanks for posting your code, I found this helpful as well. When I try to run it, Grasshopper says that I’m missing some plug-ins for a couple of the functions used, but doesn’t specify which ones. What plug-ins are you using? Thanks in advance!

I checked and it seems there is no need for any plugin.
What rhino version you are using?

Rhino 4.0 SR 9

Oh… wow :sweat_smile:
I could have helped you if it were on rhino 5, but i don’t even have installers for rhino 4.
(You should consider upgrading…)

I never even used grasshopper at “rhino 4 age”. Does your grasshopper have c# script component?
If not, try to install it.

Also, maybe some rhinocommon libraries were different, code might need to be fixed.

Thanks for replying, attached is a screenshot of the Grasshopper window. Based on your original layout, it seems about 3 main components are missing.

Yeah, you’re right, I should upgrade. I think your C++ function is working. It can at least read it.

I’ve sent you a pm.