Liste des Groupes | Revenir à s math |
Am 21.01.2025 um 00:03 schrieb Chris M. Thomasson:vec4's in GLSL are (x, y, z, w) orOn 1/20/2025 2:48 PM, Moebius wrote:C'mon... lolAm 20.01.2025 um 23:40 schrieb Chris M. Thomasson:>
>[...] Fwiw, a fun part of GLSL is doing stuff like:>
>
vec3 a = vec3(.25, 1, .75);
vec2 b = a.xz;
vec2 c = b + vec2(.75, .25);
>
c now equals (1, 1)
Nice.
>
>
In math:
>
a := (.25, 1, .75) ,
>
b := (a_1, a_3) ,
>
c := b + (.75, .25) .
>
Then c = (1, 1) .
>
:-P
>
>
Question. What if
>
vec4 a = vec4(.25, 1, .75, .999);
>
vec3 b = a.xz<?>;
>
I'd like to get b == (.25, .75, .999). :-P
>
That would be:
>
vec4 a = vec4(.25, 1, .75, .999);
vec3 b = a.xzw;
>
;^)
And then?
xyzw ... uv ...GLSL has x, y, z, w or [0], [1], [2], [3]
I usually use the "series"
x, y, z, u, v, w
in math/physics.
Les messages affichés proviennent d'usenet.