6
$\begingroup$

I was wondering for some time now if it is possible to use the Shrinkwrap modifier (in combination with other modifiers, i.e. Normal Edit) for projecting a mesh onto a surface in shadow-like manner (like shadow from a Spot Light).

Currently one can project a mesh onto a plane using Project or Nearest vertex/Surface point modes.

The first mode works well only for parallel projection along the main world axes. Using it with the mesh normals (face/vertex?) is a disaster.

The other two modes are distance based projections - so no shadow-like.

In the image below I am showing the effect that I want to achieve - projection based on reference point (the spot light) that will wrap the mesh onto the wall, over the shadow (produced by the spot light).

Any solutions, including python and add-ons, are welcome.

Thanks!

enter image description here

$\endgroup$

1 Answer 1

10
$\begingroup$

All you have to do is ray cast in the direction of the lamp starting from the vertices locations and use the points of intersection as the new vertices locations.

Node Tree

The foregoing example showed an orthogonal projection, another kind of projection would choose the ray direction based on the vertices locations as follows.

Node Tree

$\endgroup$
7
  • $\begingroup$ This is a really useful node tree for modelling. $\endgroup$
    – Robin Betts
    Commented Aug 26, 2018 at 8:45
  • $\begingroup$ Hello Omar! I was expecting that you will be able to give an answer to this problem! Once again amazing solution! Edit: One more question. I am using AN version of 2.0.4 which I am certain is outdated. Where I can download the AN version you're using? I would like to construct the examples myself. $\endgroup$ Commented Aug 26, 2018 at 12:17
  • $\begingroup$ @RumenBelev There are test builds for version 2.1 here, while this is not the latest version, it contains all of the new features except the new Spline From Edges node. $\endgroup$
    – Omar Emara
    Commented Aug 26, 2018 at 13:20
  • $\begingroup$ It worked perfectly! Another great example of how powerful AN is. It's amazing how Ray Cast node does the heavy lifting here. I love vector math but "she" doesn't love me back :) $\endgroup$ Commented Aug 26, 2018 at 19:07
  • $\begingroup$ @RumenBelev It takes time for the love to be mutual :). By the way, if your object is always a plane, you could use the Intersect Line Plane node instead of BVH ray casting, will be much faster. $\endgroup$
    – Omar Emara
    Commented Aug 26, 2018 at 19:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .