Liste des Groupes | Revenir à math |
Am 21.01.2025 um 03:50 schrieb Chris M. Thomasson:;^) well, shit happens. GLSL chose the symbol w for the 4d component of a vec4. Fwiw, in some of my work I use the 4'th dimension for plotting some of my fields. For instance, my cover of the AMS calendar used the 4'th dimension. In other words the w component was non-zero. It really casts an interesting "mutation" to the 3d components during iterations of field lines...On 1/20/2025 3:15 PM, Moebius wrote:A useful convention, I guess, when doing graphics in (3D) space; for doing it in space-time I'd prefer t instead of w here. :-PAm 21.01.2025 um 00:03 schrieb Chris M. Thomasson:>On 1/20/2025 2:48 PM, Moebius wrote:>Am 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;
>
;^)
C'mon... lol
>
And then?
vec4's in GLSL are (x, y, z, w) or
>
vec4 a = vec4(1, 2, 3, 4);
a[1] = 3.f;
>
now, a.y = 3 :^)
>>>
xyzw ... uv ...
>
I usually use the "series"
>
x, y, z, u, v, w
>
in math/physics.
GLSL has x, y, z, w or [0], [1], [2], [3]
Les messages affichés proviennent d'usenet.