Jump to content

Nonlinear texture stretching


Recommended Posts

Hello all!

Is there a way to stretch the texture non-linearly when the object is deformed? Let the texture be applied to the sphere (figure 1). As the sphere grows, the texture stretches uniformly. 

How to make so that only gray sections of the texture are stretched, and the red ones do not change  (or stretch a little) ( as in figure 2 )?

1.png

2.png

Link to comment
Share on other sites

Hi,

probably there are simpler ways, but here are some ideas:

  • split your points using the uv coordinates
  • convert uv to points (@P)
  • isolate red color (delete rest) -> each square should be connected component
  • calculate centroids for each connected component (here it is better to work on flat geometry (uv-space))
  • use nearpoint to get every point closest cluster center (from all points)
  • set scale dependent float attribute (average distance to neighbour for example)
  • rescale by this attribute towards center

 

 

uv_scale_test.hipnc

squares.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...