Project from the direction of normals

   1468   13   1
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
I have a roof geo, which I'd like to populate with rooftiles.

I'd like to apply a perfectly aligned UV map onto the faces of the roof, so I could lay them out in 3D space properly to use the bricker division.
I try to use abused normals to define the projection direction (zeroing out Y axis of the normal, so I could maintain that the bottom edge of the geo is aligned with the U coordinate of the projection, but it doesn't work.
I somebody could take a look at it I'd appreciate it

Thanks!

Attachments:
roofTest.hip (118.4 KB)

User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
you need to stash the input file, so we can take a look.
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
Sorry, my mistake, thanks!

Attachments:
roofTest.hip (130.6 KB)

User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Hey szmatefy,

I'm not 100% sure what you try, but shouldn`t you reference the angle parameter instead of N in your project node?

Cheers
CYTE
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
I tried the angle I just wanted to see, what's going on, but the angle doesn't align properly with the normals. The idea is that with N I define where I should project the texture onto the surface
User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Yea, but N is a vector and you use one value of the vector to define the rotation. that won't work.
Still, I don't understand clearly what your goal is.
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
The idea is to project the texture from the normal direction of the face but keep the face's bottom edge horizontal. This way I could make sure that the tile alignment will be fine. I'm open to other ideas as well. I tried to align the bottom edge of the face in question parallel to the X or Y axis, then use the divide node to bricker the polys, but didn't work as well. I have an arbitrarily shaped roof, unfortunately.
User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
Hi, you have to create a vector that is in degrees to be able to set the uv rotation. Normals are in radians and need to be converted. What I have done is create a rotation matrix using the lookat function and then set the trs on the uv project with a point expression.

something that I have discovered today is that you can give the lookat a 4th input which is the transform order which will spit out a vector instead of a matrix. A little easier to use and cuts out a extra step of converting it from matrix to vector

Attachments:
Auto rotate uvs.hiplc (125.3 KB)

User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Hey willh,

this is an excellent method, but the bottom edge is not aligned perfectly with the uvs.
So I made a different approach. But it's necessary for it to create a group containing the edges that should be perfectly aligned.
Take a look @szmatefy.


Cheers
CYTE
Edited by CYTE - Oct. 27, 2022 05:29:08

Attachments:
Auto rotate uvs_2.hiplc (203.9 KB)

User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
awesome,

Oh yes sorry, I didnt think to line them up. You can to that though using one of the edged as the up vector

The file you uploaded is corrupt or something, cant download it for some reason.
User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Might be cause I reuploaded it, the minute you tried to download it.
User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
very nice
User Avatar
Member
131 posts
Joined: Aug. 2012
Offline
This topic [www.sidefx.com] might be of some use to you
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
Cool, guys, thanks for the tips and help. In the mean time I also came up with ideas, which I'm about to share later.
  • Quick Links