Is this kind of planar mapping possible?

When I use planar mapping on an arbitrary oriented/shaped object, the texture gets mapped in some distorted way that I don’t understand (here a grid projected on a cylinder):

The projection options for planar mapping are Closest Point and Ray. Neither are what I’m after I hoped that Ray was a ray between the camera and the mapping plane but it involves the object’s normal (!?)

The result I’m after is this (made by splitting the surfaces with lines ExtrudeCrvToPoint to the camera origin, coarser grid because it’s a fastidious job…):

Any idea how to do this?

Here’s the file: Mapping question_2016-04-19.3dm (1017.0 KB)

I don’t know about Rhino 5, but Rhino WIP has Screen mapping for textures. This works at least with Raytraced mode. Maybe a similar mode exists for Rhino 5.

/Nathan

Hi Nathan,
Thanks for looking into this. This will probably be useful sometimes but it doesn’t work; I need the mapping to stay as it is as the camera moves around:

And I don’t quite understand what is the relation of the mapping controls in the material properties and the mapping controls in the object properties.
Render engines (such as V-Ray) have to depend on Rhino’s tools to define an object’ mapping, right?

Hi Marc,

Would the workflow outlined below work?


HTH
-Willem

I think there’s still slight distortion of the planar mapping at the edges of the sphere as you can see in your top-right viewport, but otherwise that should be pretty much how you’d do it to create a UV that simulates that.

/Nathan

Thanks for looking into this Willem,
Did you tried the file I provided?
I did exactly as you did from the start but it doesn’t work at all. Is it because of the geometry? Or the view I need?

Here’s the file, the texture used should be embedded: Mapping question_2016-04-21-rv6.3dm (4.2 MB)

A sphere works better, but there is a distortion:

It corresponds nicely to the same texture on a plane:

But is influenced by the curvature of the surface:

Hi Marc

Indeed it’s because of the geometry. I think you will need a custom mapping from an object. (The duck icon if I’m not mistaken ) the shape is a rectangular cutout of a sphere. Where the sphere is centered around the camera point. The borders are defined by the frustrum edges.
Geometrical these are 4 arcs that can create a surface via sweep2. Or a single arc partially revolved around the camera y axis

Hope this is clear, I am on my phone so rather brief.

-Willem

Hi Willem,

The sphere or the tube are only to describe the problem/bug. The geometry I need to map is way more complex than that.

No the sphere I talk about is the mapping radiating outward from the camera…does that make sense?

Yes, I get it, using a sphere portion instead of a plane.
I’ll do some experiments, thanks.

Not quite successful…

1 Like

@andy @BrianJ or …
Any idea? Bug? limitation? Stuck into actually splitting the object?

@Marc, I mentioned this issue to @DavidEranen. I think what you need is a UV mapping mode that does what the texture screen mapping does as I showed in my first reply. Or put in other words it should be like planar mapping as already exists, except that rays shouldn’t be parallel, but coming from the camera location essentially - honoring frustum etc. Maybe @DavidEranen could do something like that at some point for Rhino WIP.

Hi Marc,

I’ve got a possible solution:

Note that the numbers for the mapping are rounded to 3 digits and this limits the exact control.
Furthermore there seem to be additional errors but tweaking the numbers by hand might get the alignment good enough.

I’m signing off for today, but let me know if you need more info.

good luck
-Willem

1 Like

Hi everyone,

I made the following YouTrack item: http://mcneel.myjetbrains.com/youtrack/issue/RH-33730

I don’t know when I’ll get to it - so I would suggest trying some of the workarounds posted here.

That’s called camera projection mapping if memory serves me right. I never actually tried it in Rhino but assumed it was there. It isn’t.

Hi Willem,

Wow, that’s the solution! Logical, that how to have the rays pointing toward the camera of course.
I cannot get it to work correctly though… On the plane there’s always some skewing and the sphere gets some bizarre offset:

And the numbers in UVW repeat and offset have a logic that I don’t get…

I’m currently testing using a sphere as a custom mapping object. Seems better so far…

Hi Davis,
It seems like we should not expect the planar mapping to work as I wanted at the beginning of the thread. Spherical mapping must be the answer…

I have better results with a sphere acting as a custom mapping object.
The sphere is created like Willem suggested for the spherical mapping.

There’s good matching between the plane and the sphere;

It works well enough with other geometry too (a tube here):

It might be enough, I’ll try with my real geometry. I don’t know how to, or if it is possible, to get rid of the (pincushion?) distortion.

Also, the settings of the UVW offset/repeat/rotation make no sense to me;