Blender

Blender

Aeronark Sep 9, 2021 @ 6:29am
How would you get objects rotation in shading nodes?
I would like to first give you a bit of a run down on my thought process, because i'm not 100% sure this is the right question to be asking (there might be a different, simpler solution).

I'm working on a little project, and after rendering, i noticed that one of the textures isn't getting the correct vector, and thus, its not rotating with the object that its applied to.
Render [media.discordapp.net] (See the black pillars with blue light)

So naturally i was going to swap out the geometry nodes position vector for mapping, with texture coordinates object vector.
Object vector mapping [media.discordapp.net]
So now i have the texture rotated, but its also stretched/squished. This wouldn't really be a problem if i wasn't trying to apply the texture to different objects with different scales and sizes.

Then after a bit of trigonometry i came up with a way to take a vector, and extract the axis rotation for it. It worked.... kind of.
Rotation applied [media.discordapp.net]
What i did, was apply the geometry position vector to the textures, but connect the rotation vector i got out of the object vector. Assuming i did the maths right, it would seem that the object vector isn't the vector of the object in global coordinate system, but it's a different vector for every point of the objects surface, in the objects local coordinate system.

So finally, how would i make it so that i maintain the scale and size of the texture per object, per face, without stretching and squishing, but also rotate the texture with the object that it's being applied to?

I read that drivers may be able to do trick, but i have no idea where i would apply this driver, or what to write into it.

Thanks a lot for any answers!
Originally posted by The Renderer:
Why don't you simply use UV mapping?

Also, one step further, why don't you create a procedural material for something like this?
< >
Showing 1-5 of 5 comments
The author of this thread has indicated that this post answers the original topic.
The Renderer Sep 9, 2021 @ 11:17am 
Why don't you simply use UV mapping?

Also, one step further, why don't you create a procedural material for something like this?
If you were to use the UV map as the Input Vector, Object Rotation in World or Local Space wouldn't have any influence on the Texture Mapping.
Not sure if this is what you want, but I guess you want the Placement/ Rotation of the Pillars not influence your texture right?
Last edited by *P0P$*FR3$H3NM3Y3R*; Sep 9, 2021 @ 11:19am
Aeronark Sep 10, 2021 @ 1:52am 
Originally posted by The Renderer:
Why don't you simply use UV mapping?

Also, one step further, why don't you create a procedural material for something like this?

I tried to take one of the rectangles, apply transforms, mark seams, and then unwrap, that worked. So thanks a lot! I never really did much UV stuff so this didn't cross my mind as a solution!

Also, it is a procedural material, its just voronoi textures with some noise.
Last edited by Aeronark; Sep 10, 2021 @ 2:03am
Aeronark Sep 10, 2021 @ 1:58am 
Originally posted by *P0P$*FR3$H3NM3Y3R*:
If you were to use the UV map as the Input Vector, Object Rotation in World or Local Space wouldn't have any influence on the Texture Mapping.
Not sure if this is what you want, but I guess you want the Placement/ Rotation of the Pillars not influence your texture right?
I want the opposite, the texture to be rotated with the object its being applied to. But in a way, that doesn't stretch or squish the texture at all.

Nevermind what i said here before, UV unwrapping and mapping to UV worked, thanks!
Last edited by Aeronark; Sep 10, 2021 @ 2:04am
The Renderer Sep 10, 2021 @ 2:16am 
Originally posted by Aeronark:
Originally posted by The Renderer:
Why don't you simply use UV mapping?

Also, one step further, why don't you create a procedural material for something like this?

I tried to take one of the rectangles, apply transforms, mark seams, and then unwrap, that worked. So thanks a lot! I never really did much UV stuff so this didn't cross my mind as a solution!

Also, it is a procedural material, its just voronoi textures with some noise.

Ah ok, I wasn't sure because you said "texture". Glad it worked.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Sep 9, 2021 @ 6:29am
Posts: 5