Mapping raster images onto surfaces in Rhino ..how is this best done?


#1

Hi,

V4 or V5
I need to import raster images then map them onto aircraft fuselage surfaces in V4 or V5, whichever can manage this, these being surfaces created using sweep2rail etc.
The images are often taken slightly oblique to the original aircraft surface, the photographer not understanding the usefullness of perpendicular shots, never having to work with them afterwards !!!, so its a case of mapping each corner to where it should be and the rest will follow suit. I can use distort in Photoshop to get an oblique view to match up to a 2D ortho view, killing effect of perspective on the image etc.

How can I map these rasters onto my surfaces in rhino then draw lines through the features I am interested in ?

The aim of the exercise is to plot data from the rasters onto my surfaces, not to make my shapes look pretty.

Steve


Mapping an image on a surface that won't be distorted
(David Cockey) #2

Unless the surface is planar you cannot distort in Photoshop to get an oblique view to exactly match up to a 2D ortho view.

PerspectiveMatch finds the photo orientation and viewpoint so that the photo and corresponding portion of the Rhino model appear to be overlaid.
http://wiki.mcneel.com/rhino/perspectivematch

A line from the viewpoint through a point in the photo will pass through the corresponding point on the Rhino model. You can also loft a surface between the viewpoint and a curve on the photo, then extend the surface until it intersects the Rhino model (if needed). The curve which is the intersection of the lofted surface and the Rhino model will be the curve on the Rhino model which corresponds to the curve in the photo.


(Pascal Golay) #3

Hi Steve- Decals or planar mapping on the target objects will help here. Texture Mapping is set in the object properties - it’s the red and white cylinder icon in Properties. I’d use V5 for this.

-Pascal


#4

To illustrate my need, I have attached a test 3dm file and two different viewpoint images to map onto it.
Test1234FuselageMapping_SmashSource.3dm (99.6 KB)


I smashed the fuselage side, noted where the corners ended up, oddly enough smash went through a 90deg turn.
Took the smash, added squares in Pshop, indicated the corners as coloured arrows.
Then used distort tool which accurately mimmicks effect of photographing something at an angle. (from tests and years of use of it)
Now how can I get those oblique images back onto my unsmashed fuselage side to view in ortho and rotate in perspective.
My base level need is to be able to draw over it in ortho views.
The orange lines correspond to the middle frame just to see if it accurately maps !

I would need the images turn on and offable. I use PictureFrame for my plans normally,

This just to test method, further more useful images I shall then test with.

A jing video would be most welcome if someone can have a go.

What I mean there is that I found that if one was to photograph a railing (not sure what USA call this) but its a metal barrier with equally spaced vertical rods with another along the top to hold it all together ! at an oblique angle then open that photo in photoshop and lay it over a plan drawing also in photoshop of that actual barrier, the distort tool, not perspective tool, will with careful use get that barrier raster image to match the plan. Ditto pic of a railway line and its plan drawing.
One can then take a pic of a house front (flat faced sort of house, no porches etc) and match it to a plan view of that house front in photoshop.

The video shows a raster image in background. I bring mine in using PictureFrame as I have one per layer and need to have control over them all so I am not sure if that would be ok for me, does it work with PictureFrame ?
Furthermore its a fixed view. I need to be able to rotate the object in Perspective view, see it in the ortho views, with the image stuck to it, not have to recall a certain view to see it mapped. Must be able to then view the curved surface with the image on it in ortho views.

I know in 3d sims images are mapped onto curved surfaces, I need to do that in Rhino and then draw lines and curves over the images.

Pascal…
I am stuck, I need some official McNeel tutorials on Decals and Planar Mapping and Texture Mapping. Cant find any.
I typed decals into the command line and commandHelp doesnt recognise it, sounds interesting though,
I then googled Texture Mapping Rhino V5 but found nothing to get me started, and I dont want some fuzzy youtube video and someone I cant understand the accent of. ( I struggled with the vimeo video language in the link david gave).

Where is the official tutorial by McNeel on all this ?

I have this V4 Rhino Visual tips or whatever it was called (cant get to it right now) and it was great, and spoken in english but need something now for V5. I have just found an online visual tips, appears to be McNeel. Ran the Ch15 curves video and its not like the V4 dvd at all, not that sharp despite HD mode, I struggle to understand the mexican instructor language, just not used to such accents in UK , get we draw cur, em poyeeen em poyeeen em poyeeen…I cant understand what he’s saying that well. What has happened to the videos produced by McNeel ? Is this now it, rather than the one guy on the dvd ? I need to catch up with whats new but also be able to follow the videos.

I am struggling to find tutorials using a search engine, I even found an index at :-


but texture mapping isnt mentioned.

Steve


(Pascal Golay) #5

Here’s a start -

http://docs.mcneel.com/rhino/5/help/en-us/properties/texturemapping.html

-Pascal


#6

Hi Pascal.

Clicking the first link sees undocumented command page appear and nothing else…

I’ll play the rest and see what I can make of it.

My pattern is not truly what I need to map, I will be mapping photos of aircraft sides, so I can see where the rivet lines occur on my surfaces. I hope that user files such as photos of aircraft sides (not random textures and patterns)can be accurately placed using the methods in the videos.

meanwhile…
If anyone could map those jpgs to that surface I would be interested to see the video of it done.

Cheers
Steve


(Pascal Golay) #7

Yeah, that is weird- it worked for me once but not now - in any case, it is Rhino Help, in the index under Texture > Mapping.

-Pascal


#8

Hi Pascal,

I now know how to create a wood look handle !

Cant find anywhere despite links about using ones own image like a real photo of a fuselage side and rivets, so as to adjust its fit until it is correctly in place.

I reckon custom Uv mapping and the ability to rotate the item to orient it to the image would be a good start !

Also what was Decal ?..you mentioned Decal, and I said cant run that command.

it said unknown command .

Steve


#9

If you are looking to keep the image flat yet distort it à la Photoshop in Rhino try this:

Create your PictureFrame with your image. Turn on its control points. Now try moving one of the corner points. You will see this works a lot like Photoshop’s distortion tool. Now undo, and then Rebuild the picture frame with, say degree 3 and 4 points in both directions. Now try pulling some of the intermediate points around. Like that you can introduce all sorts of corrections/distortions in the image. If you need, you can create reference geometry (guidelines) to align the image to. You can rebuild with more points if you need more local control.

Since the PictureFrame is a planar surface, you can also just move/rotate it around in 3D to where you want it. A custom CPlane combined with Plan view might be interesting here as well.

–Mitch


#10

Hi,
Helvetosaur.
Bacially it is possible to distort the PictureFrame image in a variety of ways but all in a 2D way in Rhino. Is that what these give ? have i interpreted what you are saying correctly ?

What I have yet to find out though is can I take my 2d raster image and map it onto the surface like a model decal. Pascals mention of decal has me intrigued but its a dead end, it isnt a command and I have heard had no more about it since.

I would like to be able to choose something like a command called DecalRasterToSurface4point.

which has steps:-
select imageCorner1, then 2 then 3 then 4
now select targets, so I pick where 1 needs to go, then 2 then 3 then 4
and it takes to the surface like a decal after Microscale softening solution is applied !

That would be so quick and easy.

I dont suppose one can project an image onto a surface like curves and lines ?

I could use the distortion you mention and get it looking to fit, in ortho view, then project it onto the surface !

If I knew how to use this mapping as was used in the video but for user own image,… no reply on that from anyone… I could mess around with control points, change orientation, a lot of fiddling about though, my 4point mapping command would be ideal. The custom mapping is going to take hours I reckon and this is something I need to do again and again in the future.

No one has shown the chequers test image can be mapped as yet.

Maybe this isnt possible in an easy way.

Steve


#11

Yes. Merely suggesting this for use as a guide to creating your geometry.

No, that’s not currently possible, although I do think it might be scripted - it’s easy enough to project the pixel colors of an image to a surface object and know where they land, but I don’t know how to apply that data to the object’s render material…

–Mitch


(David Cockey) #12

Steve, how accurately does the image need to be located on the surface? Will you use the photo to create accurate geometry or will it be for appearance only? Is the object planar or does it have 3-D shape as in your example file above?

Your proposed four point mapping only works accurately for photos of flat objects, such as a flat wall or a straight railing. Add three dimensional shape such as a wall with projecting and recessed features or a curved railing and it won’t work accurately. Out of plane portions of the object in the photo will be distorted. This is fundamental to the geometry of photos.

Mapping a photo onto a surface using isocurves as done in applying texture maps to surfaces will only produce an accurate mapping in very limited circumstances.

Rhino does have a tool which allows viewing a photo and a Rhino model in alignment, PerspectiveMatch, which I mentioned above. I have previously used it to align a photo with a Rhino model of a boat hull so that the photo could be used a guide for geometry creation.


#13

Hi

Will you use the photo to create accurate geometry or will it be for
appearance only? Is the object planar or does it have 3-D shape as in
your example file above?

Its for creating accurate geometry. Or as accurate as is possible.
It will mostly be photos taken at angles, not too acute normally, also taken perpendicular where available.
The perp pics will be taken in the future for this purpose if the mapping is possible.

I dont manage to draw in perspective mode easily, so PerspectiveMatch I dont see of use to me.

Your proposed four point mapping only works accurately for photos of
flat objects, such as a flat wall or a straight railing. Add three
dimensional shape such as a wall with projecting and recessed features
or a curved railing and it won’t work accurately.

Yes I see, if I had a compound curve it wouldnt know the route to take the edge of the photo between target point 1 and target point 2.

I think the project idea has some chance, as it is sort of reversing the proces of photography, where features of a 3D item are ‘projected using light rays and lenses’ onto a planar surface.
Maybe I trace the features of the photos, adjust the perspective view to match the photo, then use Project to set the features onto the surface.
This way it overcomes the problem Helvetosaur says of

I don’t know how to apply that data to the object’s render material…

downside being its a pain tracing off the details, but I would be tracing them afterwards anyway !
Adjusting the perspective view to match would be tricky and fiddly, one touch of the mouse and its lost.

Can one save a perspective view, naming it to the name of the photo.

Steve