|
|
The following snippet of code is an extract and will not result in the final
image. It merely demonstrates the use of image_mapping to an object.
On the newsgroup povray.binaries.images I have posted three images in
response to a query on 'fix single image on surface.'
The first and second images are the maps we want to apply to our 'fuselage.'
Fuselage in your case may be a cylinder, for instance. I used a mesh, but
any object will do. Note: that specific scalings, and translations in this
definition may not work with your object, but are given as used.
You can see in the first image I posted (fuseinsig.png), that I intend to
mask off the green area, as transparent. What may not be so obvious, is the
similar intent for the black colored areas of the second image (ss1.png),
because your newsreader probably shows it as transparent, already. You can
see the result in image three (fuse.jpg).
Here is the code I used to make it.
object { Fuselage
texture { Grim_Aluminum }
texture { pigment { image_map { png "ss1.png" once transmit 0,1
interpolate 4 }
translate <-.5,-.5,-.5> scale <.15,.0125,1> rotate 90*y
translate <-.3,-.0225,-.475> }
finish { ambient .35 diffuse .365 reflection .21 } }
texture { pigment { image_map { png "FuseInsig.png" once transmit 3,1.1
transmit 8,1.1
transmit 9,1.1 transmit 10,1.1 interpolate 4 }
translate <-.5,-.5,-.5> scale <.25,.225,1> rotate 90*y translate
<-.25,-.0625,.25> }
finish { ambient .35 diffuse .365 reflection .21 } } }
Note that I 'stacked' three textures onto one object. Sometimes, this
requires fiddling with finishes. Sometimes, not.
The first translation upon the image_maps is intended to center the image,
for further scaling and translation. This is not the only way, but it makes
it much easier to think about what is going on.
After the translation, I scale the image to proper proportions, then rotate
it (the fuselage I used runs from -z to z) and finally translate it into
position.
I hope this helps.
Grim
Post a reply to this message
|
|