Tuesday, 6 March 2018

calculating nice uvs for polywires/regular surface

int div=`chs("../polywire2/div")`;
@uv.x=float(@ptnum%div)/div;

f@numRows=float(@numpt)/div;


i@rowNum=@ptnum/div;
@uv.y=float(@rowNum)/float(@numRows);


I then promote this to a vertex attribute...not sure why I didn't do it via vertx in the first place ...

The channel bits of code "chs...." just refer to the number of divisions down the tube. eg an 8 sided cylinder.

This setup keeps the UVs within 0-1 space.

No comments:

Post a Comment