Use texture to displace points

   4090   3   2
User Avatar
Member
41 posts
Joined:
オフライン
I have geometry with a texture on it and want to use the color values from the texture to displace the points on the geometry.

I can't seem to access the color of the texture using the Point SOP. Is this sort of thing possible?
~adam
User Avatar
Member
41 posts
Joined:
オフライン
I did some more digging around and figured out how to do it. In the attachment are three ways to use an image to displace points in geometry.

Using the texture on the geometry:
1. Use UV Project to texture geometry.
2. Use a Point SOP to color the points with the pic function: pic(“../cop2net1/OUT”, $MAPU, $MAPV, D_CR)
3. Use a Point SOP to displace the points using color values.
Note: This method is very effective, since your free to displace points on any shape no matter how non-uniform it is.

Using COPs and pic function
1. Load image into COPs.
2. Use a Point SOP to displace points with the pic function:
pic(“../cop2net1/OUT”, $BBX, $BBY, D_CR)
Note: This method is restricted to a perfect grid.

Using COPs to CHOPs to chopi funciton:
1. Load image in to COPs.
2. Use Image CHOP to access image data.
3. Use Point SOP to displace points using chopi funciton:
chopi(
“../chopnet1/OUT/r”+
floor(
fit(
floor($PT/100), 0, 100, 0, chopn(“../chopnet1/OUT”)
)
)
,
floor(
fit(
$PT%100, 0, 100, 0, chopl(“../chopnet1/OUT”)
)
)
)
Note: This method is also restricted to a perfect grid.

Attachments:
Image_to_geo.hip (85.4 KB)

~adam
User Avatar
Member
1390 posts
Joined: 7月 2005
オフライン
Is this what you're after?

Attachments:
img2geo.hipnc (61.0 KB)

User Avatar
Member
41 posts
Joined:
オフライン
Wow, nice file! Thanks for showing me how to do it in VEX. I've yet to learn VEX, so it's extra helpful.
~adam
  • Quick Links