U/V Axes
Quote from wrathofmobius on December 26, 2012, 9:46 pmI'm working on a Python wall tile randomizer script. I have gotten it mostly done, but the issue is that the textures do not align properly. According to the VDC:
VDC wrote:U/V Axis
The u-axis and v-axis are the texture specific axes. They hold their own designations as they are independent of the true x-axis and y-axis, but it's easier to think of them in terms of x and y. The u-axis represents the x-axis and the v-axis represents the y-axis. These two code lines work together to define how the texture is displayed upon a face.
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 1 0 0] 0.25"
u/v axis ([x y z dec] dec)
The x, y, and z are decimal values representing that axis. The following value is the translation and the last decimal is the total scaling.
The values for the x y z set represent the amount of the texture to be shown in that axis. They modify how much of the texture is shown within the normal space the texture would occupy on the face. A value of one means one repetition in the normal space, a value of two would mean two repetitions in the normal space. The key is that this only applies to one axis of the texture and is applied relative to true x, y, and z axes. That means that it is possible to set the texture to appear along an axis the plane doesn't exist in. With a flat plane in the x-axis and the y-axis definitions are only needed for those axes as any definition in the z-axis has no surface to appear on. The code sample shows how this would be generated by Hammer. The texture's x-axis (the u-axis) is displayed in the real x-axis and the texture's y-axis (v-axis) is displayed in the real y-axis. Which of the x, y, and z axes are showing the axes of the texture depends entirely upon the faces orientation. Negative values will flip textures and Hammer will generate errors about textures shown in a plane the surface does not occupy. The second to last value is the simple translation of the textures origin within that axis; this value is actually a decimal though Hammer will round it up when displaying Hammer will still save the correct decimal value. The last decimal is the overall scaling of the entire axis including what is defined in the x y z group.(source: https://developer.valvesoftware.com/wik ... orld_Class)
This makes little sense to me. Is there a way to input the x and y offset values?
I'm working on a Python wall tile randomizer script. I have gotten it mostly done, but the issue is that the textures do not align properly. According to the VDC:
The u-axis and v-axis are the texture specific axes. They hold their own designations as they are independent of the true x-axis and y-axis, but it's easier to think of them in terms of x and y. The u-axis represents the x-axis and the v-axis represents the y-axis. These two code lines work together to define how the texture is displayed upon a face.
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 1 0 0] 0.25"
u/v axis ([x y z dec] dec)
The x, y, and z are decimal values representing that axis. The following value is the translation and the last decimal is the total scaling.
The values for the x y z set represent the amount of the texture to be shown in that axis. They modify how much of the texture is shown within the normal space the texture would occupy on the face. A value of one means one repetition in the normal space, a value of two would mean two repetitions in the normal space. The key is that this only applies to one axis of the texture and is applied relative to true x, y, and z axes. That means that it is possible to set the texture to appear along an axis the plane doesn't exist in. With a flat plane in the x-axis and the y-axis definitions are only needed for those axes as any definition in the z-axis has no surface to appear on. The code sample shows how this would be generated by Hammer. The texture's x-axis (the u-axis) is displayed in the real x-axis and the texture's y-axis (v-axis) is displayed in the real y-axis. Which of the x, y, and z axes are showing the axes of the texture depends entirely upon the faces orientation. Negative values will flip textures and Hammer will generate errors about textures shown in a plane the surface does not occupy. The second to last value is the simple translation of the textures origin within that axis; this value is actually a decimal though Hammer will round it up when displaying Hammer will still save the correct decimal value. The last decimal is the overall scaling of the entire axis including what is defined in the x y z group.
(source: https://developer.valvesoftware.com/wik ... orld_Class)
This makes little sense to me. Is there a way to input the x and y offset values?
[spoiler]WOM Test 1
Laser Cube Quest
Mho' Power - Community Spotlight!
Four Corners[/spoiler]
Quote from Mevious on December 27, 2012, 12:23 amThe x and y offsets are represented by the 4th number in each thing.
For example:
"uaxis" "[1 0 0 X] 0.25"
"vaxis" "[0 1 0 Y] 0.25"
X represents the x offset, and Y represents the y offset. In the example you posted they are both 0.
The x and y offsets are represented by the 4th number in each thing.
For example:
"uaxis" "[1 0 0 X] 0.25"
"vaxis" "[0 1 0 Y] 0.25"
X represents the x offset, and Y represents the y offset. In the example you posted they are both 0.
Portal 1: Portal Pro, Resurrection, Dyad, Rexaura
Portal 2: [Coop] Electrophobia, [PTI] EotM Collection, [SP] Aperture Halloween
Quote from wrathofmobius on December 27, 2012, 1:00 amThanks, that worked! Just out of curiosity, what do the other three numbers do?
Thanks, that worked! Just out of curiosity, what do the other three numbers do?
[spoiler]WOM Test 1
Laser Cube Quest
Mho' Power - Community Spotlight!
Four Corners[/spoiler]
Quote from Mevious on December 27, 2012, 2:16 amwrathofmobius wrote:Thanks, that worked! Just out of curiosity, what do the other three numbers do?They are 3 dimensional unit vectors that represent the U/V axes of the texture. They tell the engine how to map the texture's pixels to the surface. This is useful if you want to rotate the textures.
In your example:
"uaxis" "[1 0 0 0] 0.25" (vector pointing along the X axis)
"vaxis" "[0 1 0 0] 0.25" (vector pointing along the Y axis)
(the plane normal is 0 0 1 (vector pointing along the Z axis))
This means that if you are looking down on the texture from the top, then the image will look normal (not rotated or inverted).If you rotated the texture 90 degrees clockwise it would become
"uaxis" "[0 -1 0 0] 0.25" (vector pointing along the negative Y axis)
"vaxis" "[1 0 0 0] 0.25" (vector pointing along the X axis)If you want to get into the business of rotating these things along arbitrary axes and arbitrary angles, you'll want to use rotation matrices.
Edit: In your wall randomizer it looks like you're changing the wrong value for the offset. When I tried it, I got results like:
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 128 -1 0] 0.25"I think this is supposed to be:
"vaxis" "[0 0 -1 128] 0.25"
They are 3 dimensional unit vectors that represent the U/V axes of the texture. They tell the engine how to map the texture's pixels to the surface. This is useful if you want to rotate the textures.
In your example:
"uaxis" "[1 0 0 0] 0.25" (vector pointing along the X axis)
"vaxis" "[0 1 0 0] 0.25" (vector pointing along the Y axis)
(the plane normal is 0 0 1 (vector pointing along the Z axis))
This means that if you are looking down on the texture from the top, then the image will look normal (not rotated or inverted).
If you rotated the texture 90 degrees clockwise it would become
"uaxis" "[0 -1 0 0] 0.25" (vector pointing along the negative Y axis)
"vaxis" "[1 0 0 0] 0.25" (vector pointing along the X axis)
If you want to get into the business of rotating these things along arbitrary axes and arbitrary angles, you'll want to use rotation matrices.
Edit: In your wall randomizer it looks like you're changing the wrong value for the offset. When I tried it, I got results like:
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 128 -1 0] 0.25"
I think this is supposed to be:
"vaxis" "[0 0 -1 128] 0.25"
Portal 1: Portal Pro, Resurrection, Dyad, Rexaura
Portal 2: [Coop] Electrophobia, [PTI] EotM Collection, [SP] Aperture Halloween
Quote from wrathofmobius on December 29, 2012, 1:42 amAh, makes sense. Thanks!
Ah, makes sense. Thanks!
[spoiler]WOM Test 1
Laser Cube Quest
Mho' Power - Community Spotlight!
Four Corners[/spoiler]