UVTexture - Cylindrical perfect mapping
6654 18 5- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- Konstantin Magnus
- Member
- 682 posts
- Joined: Sept. 2013
- Offline
For boxes and rectangular surfaces you could just use cubic mapping:
http://forums.odforce.net/topic/18451-uv-cubic-map-procedurally/ [forums.odforce.net]
http://forums.odforce.net/topic/18451-uv-cubic-map-procedurally/ [forums.odforce.net]
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- Konstantin Magnus
- Member
- 682 posts
- Joined: Sept. 2013
- Offline
I´d still say use cubic mapping.
Edited by Konstantin Magnus - Sept. 14, 2017 02:17:54
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
That image you posted here looks fine.
Yesterday, I tried the vertex wrangle you posted, and didnt worked for me.
The -X, X primitives UVs are rotated 90º down.
Attribute Wrangle(Vertices):
Yesterday, I tried the vertex wrangle you posted, and didnt worked for me.
The -X, X primitives UVs are rotated 90º down.
Attribute Wrangle(Vertices):
vector bbox = relbbox(0, @P);
vector side = sign(@N);
vector nml = abs(@N);
vector size = getbbox_size(0);
vector ratio = size / max(size);
vector scale = bbox * ratio;
//if (nml.x == max(nml)) { @uv = set(-scale.z * side.x, scale.z, 0); }
if (nml.x == max(nml)) { @uv = set(scale.y * side.x, scale.z, 0); }
else if (nml.y == max(nml)) { @uv = set(scale.x * side.y, scale.z, 0); @uv.y += 1; }
else { @uv = set(scale.x * side.z, scale.y, 0); @uv.y += 2; }
@uv *= 0.3333;
@uv.x += 0.5;
- Konstantin Magnus
- Member
- 682 posts
- Joined: Sept. 2013
- Offline
You probably have to switch two vector components in the code or so. I will look into it over the weekend.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Konstantin Magnus
- Member
- 682 posts
- Joined: Sept. 2013
- Offline
vector bbox = relbbox(0, @P);
vector side = sign(@N);
vector nml = abs(@N);
vector size = getbbox_size(0);
vector ratio = size / max(size);
vector scale = bbox * ratio;
if (nml.x == max(nml)) { @uv = set(-scale.z, scale.y * side.x, 0); }
else if (nml.y == max(nml)) { @uv = set(scale.x * side.y, -scale.z, 0); @uv.y += 1; }
else { @uv = set(scale.x * side.z, scale.y, 0); @uv.y += 2; }
@uv *= 0.3333;
@uv.x += 0.5;
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- Konstantin Magnus
- Member
- 682 posts
- Joined: Sept. 2013
- Offline
What do you mean? The script is just doing cubic UV mapping. All it does is dividing UV islands by the primitives main orientation. And its mapping straight from the sides.
Maybe append a UVlayout node, but it´s a bit hard to tell what you are after.
Maybe append a UVlayout node, but it´s a bit hard to tell what you are after.
Edited by Konstantin Magnus - Oct. 21, 2017 08:45:08
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
Hi, that's right, but you can manually remove the cuts.
I made them to avoid distortions.
Maybe then UV edit/move the points.
If I'm right, then you'll need for perfect fit,
a volume based shader or real geometry.
I made them to avoid distortions.
Maybe then UV edit/move the points.
If I'm right, then you'll need for perfect fit,
a volume based shader or real geometry.
Edited by matthias_k - Oct. 22, 2017 11:42:55
English is not my native language, sorry in advance for any misunderstanding :-)
- Konstantin Magnus
- Member
- 682 posts
- Joined: Sept. 2013
- Offline
If you want all projections to line up, you have got to simplify the code a little:
vector bbox = relbbox(0, @P); vector side = sign(@N); vector nml = abs(@N); vector size = getbbox_size(0); vector ratio = size / max(size); vector scale = bbox * ratio; if (nml.x == max(nml)) { @uv = set(-scale.z, scale.y * side.x, 0); } else if (nml.y == max(nml)) { @uv = set(scale.x * side.y, -scale.z, 0); } else { @uv = set(scale.x * side.z, scale.y, 0); } @uv = abs(@uv);
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
That is Mathias, the code supported by Konstantin is very good if we want to paint after outside in Mari or Substance Painter. There are little seams that are appreciated when the camera is near them.
I tried another way using node UVProject (Cylindrical). But same as UVTexture, when the proportions of the chimney changes the texture 1:1 ratio distorses.
For the “real geomtry projected” I will try soon the file you uploaded. Thanks.
I tried another way using node UVProject (Cylindrical). But same as UVTexture, when the proportions of the chimney changes the texture 1:1 ratio distorses.
For the “real geomtry projected” I will try soon the file you uploaded. Thanks.
Edited by bhb - Oct. 22, 2017 15:03:34
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
If you need it only on the sides, with small convex shape…
then maybe define first UVs, then deform.
This should give a perfect match, if the texture is seamless.
Ups, vertical line should have same point count like the lattice deformer (4)
then maybe define first UVs, then deform.
This should give a perfect match, if the texture is seamless.
Ups, vertical line should have same point count like the lattice deformer (4)
Edited by matthias_k - Oct. 22, 2017 15:38:09
English is not my native language, sorry in advance for any misunderstanding :-)
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
Better…
to change the width, depth, modify the “curve1”, the multiplier for the UVs
is:
vertical the height of the “line1”
horizontal the point count of “curve1”
with this 2 values in mind you can easilly add a UV transform and set right multiplier.
to change the width, depth, modify the “curve1”, the multiplier for the UVs
is:
vertical the height of the “line1”
horizontal the point count of “curve1”
with this 2 values in mind you can easilly add a UV transform and set right multiplier.
Edited by matthias_k - Oct. 22, 2017 15:50:09
English is not my native language, sorry in advance for any misunderstanding :-)
-
- Quick Links