Rotate texture map, how to

lannabullslannabulls Posts: 0
edited December 1969 in Poser Discussion

Hi,
sorry for my silly question:
Poser pro 2012, in the mats lab I assign a 2d texture to the diffuse color node,
I found the commands for u, v scale, offset, tiling, how can I rotate the texture? So stupid I cant find the how to do it,
Could you please tell me?
Thanks a lot

Comments

  • Richard HaseltineRichard Haseltine Posts: 96,668
    edited December 1969

    You can get the U, V values from the Variable brick which you could transform using basic trigonometric functions - for a rotation angle A you'd replae u with U * Cosine A + V * sine A - but I don't see a way to feed the modified values into an image node to alter which colour is taken.

  • lannabullslannabulls Posts: 0
    edited September 2013

    You can get the U, V values from the Variable brick which you could transform using basic trigonometric functions - for a rotation angle A you'd replae u with U * Cosine A + V * sine A - but I don't see a way to feed the modified values into an image node to alter which colour is taken.

    Thanks a lot Richard,
    I dont understand your suggestion, sorry,
    I'm a beginner.
    What Variable brick is?
    Probably I'm following the wrong appproach, so an example to give you more info to answer.
    http://img856.imageshack.us/img856/449/xg7p.jpg
    In the photo above a wood texture applied to a spearfishing gun, I exagerate it, do not tile, to make you better understand.
    As you can see the wood veins (red arrow) are at 45 degrees angle, what I have to do if I would like to rotate them, making them following the gun barrel lenght as it should be in reality? In 3d studio max for example i have a command (more than one) that allow me to turn the texture or the tiles in U or V or W coordinates.
    Thanks a lot!

    Post edited by lannabulls on
  • edited September 2013

    The altered coordinates should be connected to the texture map at the UOffset and VOffset inputs.

    At a point P with coordinates {u,v} you want to instead show the point P' {ucosα + vsinα, vcosα - usinα}, where α is the angle to rotate the image. To get the U and V offsets, calculate ΔP = P - P' = {u - (ucosα + vsinα), v - (vcosα - usinα)}.

    Since the offset is just the difference between the two points, it doesn't matter where the origin of the UV coordinate system is, as long as you use the same origin for P and P'. That means that for the purpose of the calculation you can move the origin somewhere in the middle of the image map and rotate it around that, if you like.

    I'll attach a node setup (for the Advanced Material Room) to my post that I hope will show what I'm trying to say.

    Most of the nodes shown are Math Functions bricks. I renamed a few of them to show what I was using them for.

    rotate2.png
    956 x 566 - 368K
    rotate.png
    400 x 400 - 6K
    Post edited by thatmoroboshi_5f704e2d19 on
  • lannabullslannabulls Posts: 0
    edited December 1969

    Thanks a lot Fuzzy Gnome for your explaination, you are very, very kind.
    Unfrtunately, obviously it is my fault, I'm just a beginner and I dont know much about mathematics too, it is a little bit to early for me such complex material, all those to me complex nodes just to turn a texture! That means, about your explanations basically
    I did not understand anything, hehehe!!!!!
    I'm going to make my home work, try to learn about math function nodes, hoping I'm going to understand your explanation.
    In the main time, if I want to turn my texture, I just recreate the material in your photo and I'm going to edit the values that you circled in blue, right?
    Really thanks!

  • Lissa_xyzLissa_xyz Posts: 6,116
    edited September 2013

    It's all in the UV Scaling and Coords of the Image Map node. I've had this saved to my desktop for a while. IIRC it was bagginsbill who originally did the image. Also, what I've noticed is that the rotation isn't visible in the viewport, but only during render and in the material room- at least that's how it worked with the mats I've done it with so far.

    Keep in mind, that you'll have to match whatever you set your diffuse map to to your other maps as well (displace, bump, etc).

    Poser_Nodes_-_Rotate_textures.jpg
    837 x 461 - 75K
    Post edited by Lissa_xyz on
  • WendyLuvsCatzWendyLuvsCatz Posts: 37,786
    edited December 1969

    OK my appologies if this is a dumb suggestion
    but
    why not just rotate and resave the image or a copy of the map using MS paint (or photoshop etc if you must)?

    sneaks back out of Posers confusing wacros room thingy back to Carrara's shader room with little turning arrows

  • Richard HaseltineRichard Haseltine Posts: 96,668
    edited December 1969

    Thanks, Fuzzy Gnome, I was being too literal minded (thinking of feeding the new U, v values in directly).

  • edited December 1969

    In the main time, if I want to turn my texture, I just recreate the material in your photo and I'm going to edit the values that you circled in blue, right?
    Really thanks!

    Change the circled values to center the image, change the number 45.0000 above in the math brick I labelled "Angle" to rotate it.
    All the math bricks and the U Texture Coordinate and V Texture Coordinate bricks are to be added to the existing material, and plugged into the U_Offset and V_Offset inputs of the texture you're trying to change.

  • Lissa_xyzLissa_xyz Posts: 6,116
    edited December 1969

    Isn't that just a massive and unnecessary node structure for something that can be done right on the image_map node?

  • lannabullslannabulls Posts: 0
    edited December 1969

    Thanks a lot everybody for you patience with my basic questions and poor writen English too!
    Ok Fuzzy Gnome I did understend, "VCenter node" determines where the texture center is, the node labelled Angle allows to change rotation value.
    The "angle node", you rename it to give more clear explaination, by default is labeled, math function.
    Vaskania thanks a lot for your help too, wait for Fuzzy Gnome answer to understand why he suggested that complex node compared to yours.
    In the main time, i try to recreate your suggestion with my wood texture, I can just scale it, I could not turn it. Probaly I dont understand what you mean even if your example is very easy and clear.
    Really thanks!!!!!

  • Lissa_xyzLissa_xyz Posts: 6,116
    edited September 2013

    OK my appologies if this is a dumb suggestion
    but
    why not just rotate and resave the image or a copy of the map using MS paint (or photoshop etc if you must)?

    sneaks back out of Posers confusing wacros room thingy back to Carrara's shader room with little turning arrows

    Heh. This is just a quicker route that doesn't require launching another program, and only requires one copy of the image.

    Post edited by Lissa_xyz on
  • edited December 1969

    Vaskania said:
    Isn't that just a massive and unnecessary node structure for something that can be done right on the image_map node?

    I don't know that there's a way to rotate an image 45 degrees on the node, or tweak it a degree or two until it looks OK in a test render.

  • lannabullslannabulls Posts: 0
    edited December 1969

    Thanks to everybody for your help.
    To be precise so I hope I will get a final answer, look please at the 3 linked photos of my 3d studio max screen shot:
    http://img196.imageshack.us/img196/3896/s2dn.jpg
    as you can see I just apply a wood texture to my gun. Wood veins are perpendicular to the gun barrel lenght (red cross), they are displaied in the wrong way, they must be parallel; no tiling and rotation is applied jet.
    http://img46.imageshack.us/img46/7671/sech.jpg
    I rotate the texture in its W value of 90 Degrees (circle in blue), now wood veins are properly displaied (in red), they are parallel to the gun barrel lenght.
    http://img546.imageshack.us/img546/6275/58g8.jpg
    I apply a value of 4 to my U and V tiling (circled in blue) to give the right proportion.

    So both methods above suggested, thanks again Fuzzy Gnome and Vaskania, allow texture rotation in U and V direction, what about W direction?
    Cause in my case I need to rotate that value, I need to rotate the W value.
    In Poser is it possible to do so, tiling for sure, rotate in all 3 values U,V and W, I'm not sure. Is it possible to do that in Poser or it cant be done?
    Thanks a lot for your help and sorry if by my question I generate some confusion, I'm just a beginner with a lot of questions in mind , I have everything to learn.

  • Richard HaseltineRichard Haseltine Posts: 96,668
    edited December 1969

    If you are working in 3DS, could you not bake its wood pattern to a texture (well, textures if you want bump etc.) and use the result in Poser directly, with no need to rotate? You won't get the same wood effect from a Poser procedural anyway.

  • lannabullslannabulls Posts: 0
    edited December 1969

    ThanksRichard,
    I asume that the answer to my last question is a big no.
    As you told in my case baking maps and import them to Poser is the easiest way.
    I ask the above question just to learn cause, as beginner, I was surprise that I cold not find a rotate command, plus my material is a litle bit more complex
    than a simple wood texture. It is a spearfishing gun, it gets scratched by using it in the ocean so the texture that I made in max is a multi layers one: wood, a laquer coat then scratches and stains. So I already tried a bake texture and I dont like the result, as you suggested may it is better to try a poser procedural.
    The final render it will be made in poser also because I'm not able to make poser fusion work properly, I import a subject to Max, it will show up however no textures or mats applied and no pose or morphs too. I save a subject with all the textures, I pose it then save as ".pz3" file. Import trough poser fusion, it shows up in max in zero out position, poses are not imported, and with no textures on it. Months ago I already open a tiket with SmithMicro about, a solution never came out, however this is a subject that has nothing to do with this thread, I was just explaining.
    Thanks everybody for your precious help

  • EventMobilEventMobil Posts: 11
    edited December 1969

    Thanks a lot, Fuzzy Gnome, this was exactly what I was looking for, too! Very well explained!

    To all those who don't have imagination about why to use this:
    Placing some scars on different characters in a scene. I need to place on four different people, on legs, arms, body and head. I need to place color as well as bump/displacement, so given that I needed to re-paint 3 texture maps plus 3 bump maps per character, I need to re-paint a total of 24 texture maps in Paintshop...

    With Fuzzy Gnome's shader I simply need to add it to the textures inside the material room, then I can blend the scars into the original textures. But they are not rigid: I can shift and scale the scars and rotate them inside Poser, so I can immediately see where they appear and if they look good, or if they should be moved/scaled/rotated.

    I never ever put a tattoo on a skin through Paintshop, but instead through a black/white mask inside Poser Material Room, so I can carefully place it (and now rotate it).

    Think of animation, can't you imagine placing a texture of something upon an object and then move (including rotating) it as an effect? How about an alien-worm moving underneath the skin, so I need the displacement map to be altered by my worm bump map, and move this displacement texture and also rotate it?

    Possibilities are very many, so thanks again Fuzzy Gnome for sharing this very useful knowledge.

    Cheers, Martin

Sign In or Register to comment.