Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #400708 > unrolled thread

Default signedness of 'plain' char.

Started bygazelle@shell.xmission.com (Kenny McCormack)
First post2026-08-02 14:17 +0000
Last post2026-08-06 15:33 -0700
Articles 20 on this page of 133 — 18 participants

Back to article view | Back to comp.lang.c


Contents

  Default signedness of 'plain' char. gazelle@shell.xmission.com (Kenny McCormack) - 2026-08-02 14:17 +0000
    Re: Default signedness of 'plain' char. Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-03 02:45 +0800
      Re: Default signedness of 'plain' char. gazelle@shell.xmission.com (Kenny McCormack) - 2026-08-03 01:47 +0000
        Re: Default signedness of 'plain' char. Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-03 23:14 +0800
          Re: Default signedness of 'plain' char. bart <bc@freeuk.com> - 2026-08-03 17:04 +0100
            The Spanish Inquisition (was: Re: Default signedness of 'plain' char.) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-04 00:23 +0800
              Re: The Spanish Inquisition bart <bc@freeuk.com> - 2026-08-03 18:03 +0100
                Re: The Spanish Inquisition Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-04 01:26 +0800
          Re: Default signedness of 'plain' char. Theo <theom+news@chiark.greenend.org.uk> - 2026-08-04 13:13 +0100
            Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 07:30 +0000
              Re: Default signedness of 'plain' char. Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-05 18:18 +0800
                Re: Default signedness of 'plain' char. bart <bc@freeuk.com> - 2026-08-05 17:20 +0100
                  Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 21:57 +0000
                  Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-05 15:29 -0700
    Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-03 09:56 +0200
      Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-03 13:56 -0500
    Re: Default signedness of 'plain' char. antispam@fricas.org (Waldek Hebisch) - 2026-08-03 13:48 +0000
    Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-03 14:47 +0000
    Re: Default signedness of 'plain' char. Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-08-03 14:47 +0000
      Re: Default signedness of 'plain' char. Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-08-03 15:04 +0000
        Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-03 16:58 -0700
          Re: Default signedness of 'plain' char. Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-08-04 15:10 +0000
            Re: Default signedness of 'plain' char. scott@slp53.sl.home (Scott Lurndal) - 2026-08-04 15:50 +0000
            Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 03:00 +0000
            Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-05 09:01 +0200
        Re: Default signedness of 'plain' char. antispam@fricas.org (Waldek Hebisch) - 2026-08-04 18:10 +0000
          Compilers targetting the C64 (was: Re: Default signedness of 'plain' char.) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-05 03:17 +0800
          Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-04 16:25 -0500
          Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 02:57 +0000
            Re: Default signedness of 'plain' char. Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-05 00:19 -0500
              Re: Default signedness of 'plain' char. Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-05 18:57 +0800
              Re: Default signedness of 'plain' char. scott@slp53.sl.home (Scott Lurndal) - 2026-08-05 14:33 +0000
              Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-05 22:38 +0000
          Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-04 21:36 -0700
            Re: Default signedness of 'plain' char. antispam@fricas.org (Waldek Hebisch) - 2026-08-06 00:21 +0000
    Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-03 13:20 -0700
      Re: Default signedness of 'plain' char. bart <bc@freeuk.com> - 2026-08-03 22:06 +0100
        Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-03 14:25 -0700
          Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-03 18:38 -0500
            Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-03 19:34 -0700
              Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-05 04:40 -0500
            Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 07:22 +0000
              Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-05 04:02 -0500
                Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-05 12:35 +0200
                Re: Default signedness of 'plain' char. Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-05 18:49 +0800
                  Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-05 12:39 -0700
                    Dear Chris (was: Re: Default signedness of 'plain' char.) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-06 20:15 +0800
                      Re: Dear Chris bart <bc@freeuk.com> - 2026-08-06 15:05 +0100
                        Re: Dear Chris Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-06 23:16 +0800
                        Re: Dear Chris David Brown <david.brown@hesbynett.no> - 2026-08-06 20:10 +0200
                Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 21:54 +0000
                  Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-06 04:49 -0500
                    Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-07 00:10 +0000
                      Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-07 09:56 +0200
              Re: Default signedness of 'plain' char. James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-05 13:33 -0400
                Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 21:50 +0000
                  Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-06 10:34 +0200
                    Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-09 15:19 -0500
                      Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-09 20:33 +0000
                        Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-09 18:04 -0700
                          Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-10 02:45 +0000
                            Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-10 02:24 -0700
                      Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-09 18:03 -0700
                        Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-10 08:58 +0200
                          Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-10 15:17 -0500
                            Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-10 15:19 -0700
                              Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-10 17:31 -0500
                                Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-10 23:48 +0000
                                Re: Default signedness of 'plain' char. James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-10 20:03 -0400
                                  Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-10 20:44 -0500
                                    Re: Default signedness of 'plain' char. James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-11 11:17 -0400
                                      Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-11 14:54 -0500
                                        Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-12 03:36 +0000
                                          Re: Quaternions (was Re: Default signedness of 'plain' char.) BGB <cr88192@gmail.com> - 2026-08-12 01:24 -0500
                                            Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-12 07:47 +0000
                                              Re: Quaternions (was Re: Default signedness of 'plain' char.) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-12 12:52 -0700
                                                Re: Quaternions (was Re: Default signedness of 'plain' char.) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-12 12:56 -0700
                                                Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-13 02:16 +0000
                                                  Re: Quaternions (was Re: Default signedness of 'plain' char.) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-12 21:04 -0700
                                                Re: Quaternions (was Re: Default signedness of 'plain' char.) BGB <cr88192@gmail.com> - 2026-08-12 23:07 -0500
                                                  Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-13 05:00 +0000
                                                    Re: Quaternions (was Re: Default signedness of 'plain' char.) BGB <cr88192@gmail.com> - 2026-08-13 04:37 -0500
                                                      Re: Quaternions (was Re: Default signedness of 'plain' char.) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-13 14:36 -0700
                                                        Re: Quaternions (was Re: Default signedness of 'plain' char.) BGB <cr88192@gmail.com> - 2026-08-13 23:07 -0500
                                                      Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-13 23:44 +0000
                                                        Re: Quaternions (was Re: Default signedness of 'plain' char.) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-13 18:50 -0700
                                                          Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-14 02:41 +0000
                                                            Re: Quaternions (was Re: Default signedness of 'plain' char.) BGB <cr88192@gmail.com> - 2026-08-13 23:47 -0500
                                                              Re: Quaternions (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-14 04:59 +0000
                                      Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-11 13:47 -0700
                                        Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-13 23:50 -0500
                                          Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-14 05:59 +0000
                                            Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-14 03:16 -0500
                                              Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-14 08:32 +0000
                                            Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 12:36 -0700
                                              Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-15 03:16 +0000
                                                Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 22:38 -0700
                                                  Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-16 00:08 +0000
                                          Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-14 12:17 -0700
                                  Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-11 13:46 +0000
                                    Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-11 13:49 -0700
                                Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-11 08:58 +0200
                                  Re: Default signedness of 'plain' char. BGB <cr88192@gmail.com> - 2026-08-11 04:03 -0500
                            Re: Default signedness of 'plain' char. steve g <Sgonedes1977@gmail.com> - 2026-08-10 20:29 -0400
                            Re: Vectors! Quaternions! (was Re: Default signedness of 'plain' char.) Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-11 03:58 +0000
                            Re: Default signedness of 'plain' char. David Brown <david.brown@hesbynett.no> - 2026-08-11 09:06 +0200
                      Re: Default signedness of 'plain' char. Ross Finlayson <ross.a.finlayson@gmail.com> - 2026-08-10 21:15 -0700
                        Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-11 04:52 +0000
                          Re: Default signedness of 'plain' char. Ross Finlayson <ross.a.finlayson@gmail.com> - 2026-08-11 06:45 -0700
                            Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-11 14:01 -0700
              Re: Default signedness of 'plain' char. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-05 12:36 -0700
      Re: Default signedness of 'plain' char. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-05 07:18 +0000
    Re: Default signedness of 'plain' char. Lynn McGuire <lynnmcguire5@gmail.com> - 2026-08-05 18:30 -0500
      Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-05 16:41 -0700
        Re: Default signedness of 'plain' char. bart <bc@freeuk.com> - 2026-08-06 01:24 +0100
          Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-05 17:46 -0700
          Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-06 22:59 +0000
            Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-06 19:54 -0700
              Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-07 11:02 +0000
                Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-07 10:35 -0700
                  Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-07 18:32 +0000
                    Re: Default signedness of 'plain' char. Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-07 20:55 +0200
                Use of isascii() back in early days (was Re: Default signedness of 'plain' char.) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-07 20:51 +0200
                  Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-07 13:03 -0700
                    Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-07 13:32 -0700
                    Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.) cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-07 21:44 +0000
                    Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-07 23:47 +0200
                      Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-07 15:26 -0700
        Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-06 22:57 +0000
          Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-06 18:23 -0700
            Re: Default signedness of 'plain' char. cross@spitfire.i.gajendra.net (Dan Cross) - 2026-08-07 11:47 +0000
      Re: Default signedness of 'plain' char. scott@slp53.sl.home (Scott Lurndal) - 2026-08-06 14:40 +0000
        Re: Default signedness of 'plain' char. Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-06 15:33 -0700

Page 5 of 7 — ← Prev page 1 2 3 4 [5] 6 7  Next page →


#401103 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-13 05:00 +0000
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115jj0p$1c1mo$1@dont-email.me>
In reply to#401099
On Wed, 12 Aug 2026 23:07:35 -0500, BGB wrote:

> I am starting to run into a problem where, some of the sorts of
> stuff I want to do are effectively more complex than what a language
> like SCAD can deal with effectively.
>
> It has various things built-in, but no ability to specify or
> construct generalized brushes.

Immediately I’m thinking “modelling/rendering engine with Python API”.

May be worth looking at Blender for this. Its Python API is probably
the most extensive of any content-creation app.

> As for CSG vs mesh modeling:
>
> CSG: Specifies solid shapes, which is more useful if 3D physics
> needs to get involved, or you want to turn it into something you can
> 3D print.
>
> Meshes: More popular/traditional for 3D graphics, and more easily
> achieves natural shapes. But, worse suited to any sort of physical
> simulation, particularly if using non-closed meshes.

Blender has both.

> But, yeah, achieving a look similar to ReBoot via CSG could very
> well be possible. If wanting a more modern / "organic" look, this
> doesn't map as well to CSG, but as I see it, isn't always necessary
> or desirable (the obsession among AAA gaming of making everything
> look "photorealistic" has become in some sense misguided).

Photorealism seems to be routine and no longer quite as exciting.

So now the new thing (or one new thing) is starting with a 2D
animation style and adding some 3D elements to it
<https://studio.blender.org/projects/singularity/>.

[toc] | [prev] | [next] | [standalone]


#401106 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromBGB <cr88192@gmail.com>
Date2026-08-13 04:37 -0500
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115k3hr$1h0m9$1@dont-email.me>
In reply to#401103
On 8/13/2026 12:00 AM, Lawrence D’Oliveiro wrote:
> On Wed, 12 Aug 2026 23:07:35 -0500, BGB wrote:
> 
>> I am starting to run into a problem where, some of the sorts of
>> stuff I want to do are effectively more complex than what a language
>> like SCAD can deal with effectively.
>>
>> It has various things built-in, but no ability to specify or
>> construct generalized brushes.
> 
> Immediately I’m thinking “modelling/rendering engine with Python API”.
> 
> May be worth looking at Blender for this. Its Python API is probably
> the most extensive of any content-creation app.
> 
>> As for CSG vs mesh modeling:
>>
>> CSG: Specifies solid shapes, which is more useful if 3D physics
>> needs to get involved, or you want to turn it into something you can
>> 3D print.
>>
>> Meshes: More popular/traditional for 3D graphics, and more easily
>> achieves natural shapes. But, worse suited to any sort of physical
>> simulation, particularly if using non-closed meshes.
> 
> Blender has both.
> 

I wouldn't want to make things dependent on Blender...

Blender is a pretty big / heavyweight tool; and depending on Blender and
Python is not exactly a small dependency.

Like, my existing pipeline doesn't already depend on Blender, and I have 
no reason to add it as a dependency.



For SCAD, was able to shove a converter into BGBCC mostly reusing the C 
parser as a SCAD parser. Even if there were syntactic differences, it 
was "close enough", and BGBCC already included a makeshift AST-level 
interpreter.


If doing a standalone thing, would want to do it differently though. I 
have an experiment for a small JavaScript style interpreter. It was 
partly reused as a basis when starting to write a GLSL compiler.

Could also be modified either into a SCAD interpreter, or possibly for a 
JS/SCAD hybrid.

I might go this route if I wanted to add similar functionality into my 
BT3 engine (not going to copy BGBCC's C parser and similar over, that is 
also too big of a chunk of code to justify copy/pasting for this). Made 
sense in BGBCC though since it already had a C parser and the syntax was 
"close enough" to what the parser could already deal with.


Though, it is a question of if I do something custom, how closely to 
stick to SCAD, vs how much to diverge. One option could be to mostly 
keep the same basic notation and structure as SCAD, but then extend it 
with some more JavaScript-like features.


I would have to decide on the syntax. The BT3 engine already has some 
CSG code, and this was the source of what I had copied into BGBCC for 
its converter.

Though, the BT3 engine had used a makeshift language I called CSG-BASIC, 
which leaves something to be desired.

The CSG-BASIC syntax was more like:
   LET obj1 = (CSGAABB mins:[-10,-10,-10], maxs:[10,10,10])
   LET obj2 = (CSGSPHERE radius:5, origin:[0,0,15])
   LET obj3 = (CSGUNION obj1, obj2)
   RETURN obj3

With control flow more like:
   LABEL1:
   ...
   RETURN
   ...
   GOSUB LABEL1
Well, and:
   IF (cond) THEN command
   IF (cond) GOTO label
   ...

Where, in this case (COMMAND args...) would evaluate the command and 
return its value as an expression (for commands that could be evaluated 
as expressions).

Also it had a quirk that when inside of a "GOSUB" call, LET could create 
variables inside of a local dynamic frame rather than the toplevel 
(simple assignment would assign an existing variable, whereas LET could 
create a variable if it didn't already exist).

Likewise:
   LET var = (GOSUB label var1:val1, var2:val2)
Would function as a makeshift function call, binding the named variables 
in the callee's dynamic frame.


Rationale was mostly that I could fit the whole parser + interpreter in 
around 2000 lines of C (whereas for an interpreter for a JavaScript 
style language (though, can be done in around 1000 lines if limiting the 
scope closer to something like AppleSoft BASIC; with much of the 
remaining 1000 lines being stuff it needed for the CSG support), it 
needs closer to around 6000 lines of C).

Things like the wonky subroutine call mechanism was mostly because that 
was what I could do in the least amount of code (rather than what made 
sense for "good" language design).

Also it was originally written as a very quick/dirty scripting language 
for the BT3 engine (and a similar language exists in my TestKern OS, 
albeit without the CSG features).



Major difference vs this and a JS variant is that JS needs an AST parser 
and AST walker and similar, whereas with BASIC it is mostly possible to 
resolve tokens into index numbers and use tokens to drive the 
interpreter (and can use a simpler tokenizer, ...).

Note that LOC cost here also includes tokenizer, dynamic typesystem, and 
memory management stuff (would be less if these were not counted).

I didn't count a lot of the math code though, or the 3D model load/save 
code (these were counted as part of the BT3 engine itself, rather than 
part of CSG-BASIC).



When I did CSG-BASIC though. I already had some bits of CSG code around 
as some past projects had used CSG, but in this case I had modeled it to 
support local hierarchical transformation of the brush models (which 
were now organized into a tree rather than a flat list).

Though, another option could be instead extending CSG-BASIC with more 
"Structured-BASIC" like functionality (like QBasic or VisualBasic).



Or, a 3rd option could be to do something similar, but go over to a Lisp 
dialect (an S-Expression parser/walker can also be expressed in a 
relatively modest amount of code).


Mostly a matter of which route is "better".

...



Well, going back a ways, an older format had represented entities and 
CSG brushes with a notation like:
{
"classname" "func_button"
...
{
( x0 y0 z0 ) ( x1 y1 z1 ) ( x2 y2 z2 ) texname \
   [ sx sy sz so ] [ tx ty tz to ]
...
}
}
Note, slash and linebreak because of word-wrap, original format has it 
all on one line.


But, at its core, similar stuff...
Would give planes as 3 vertices, though the vertices themselves didn't 
really matter as much, they merely gave 3 points on a plane.

Or, at least this was one variant, there were a bunch of different 
variants of the format that diverged in various ways (like how exactly 
they specified the plane and texture orientation).

Format wasn't very dynamic, mostly used to specify world maps.


But, if used for CSG modeling it isn't *that* different.
Even if now you need to throw an interpreter onto it to build the list 
of brushes.


>> But, yeah, achieving a look similar to ReBoot via CSG could very
>> well be possible. If wanting a more modern / "organic" look, this
>> doesn't map as well to CSG, but as I see it, isn't always necessary
>> or desirable (the obsession among AAA gaming of making everything
>> look "photorealistic" has become in some sense misguided).
> 
> Photorealism seems to be routine and no longer quite as exciting.
> 
> So now the new thing (or one new thing) is starting with a 2D
> animation style and adding some 3D elements to it
> <https://studio.blender.org/projects/singularity/>.


One interesting style IMO was a game known as "Chants of Sennaar"...

It basically used a limited number of colors per-area, with basic 
shading, and relatively basic character designs (no visible faces, no 
voice acting or other flourishes, ...). Each area would have its own 
color palette.

Or, another example being "Untitled Goose Game" where the player plays 
as a Goose that goes around and messes with people. Nearly everything in 
the game is fairly simplistic, characters mostly lack faces, and most of 
the graphics are flat-shaded (some textures may be used, but in a 
simplistic way that doesn't break from the flat-shaded look).


Partly for related reasons (and partly for the lack of texture-map 
support in the SCAD format), most of the 3D models I made for my BT3 
engine were flat shaded as well.

Apart from CSG-BASIC having the option of using textures, but most of 
the static models were SCAD. For now, CSG-BASIC just being needed for 
the models with skeletal animation.


Well, and for my 3D model of a guy inspired by the general design of the 
skinny guy in the "Money for Nothing" video, I also still went for flat 
shading.

Though, partly I originally wrote the model in SCAD and then transcribed 
it to CSG-BASIC.


Also rather than specifying texture projection per-face, it was mostly 
specified with a mapping style. Like the texture would be mapped to the 
inside of a virtual cube or sphere or similar, and then the normal plane 
normal and vertex coords would be used to figure out the texture coords.

[toc] | [prev] | [next] | [standalone]


#401126 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-13 14:36 -0700
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115ldce$20u1b$1@dont-email.me>
In reply to#401106
On 8/13/2026 2:37 AM, BGB wrote:
[...]

Fwiw, I made this in OpenSCAD, its pretty nice. openscad Almost reminds 
me of povray...

https://skfb.ly/oqQEV

[toc] | [prev] | [next] | [standalone]


#401143 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromBGB <cr88192@gmail.com>
Date2026-08-13 23:07 -0500
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115m4i7$27hjl$1@dont-email.me>
In reply to#401126
On 8/13/2026 4:36 PM, Chris M. Thomasson wrote:
> On 8/13/2026 2:37 AM, BGB wrote:
> [...]
> 
> Fwiw, I made this in OpenSCAD, its pretty nice. openscad Almost reminds 
> me of povray...
> 
> https://skfb.ly/oqQEV
> 
> 

Similar syntax, as can be noted.


A few limitations I have found, but still deciding on a strategy 
(whether to extend the language for my own uses, or make/use a different 
one that does the same basic thing but addresses a few of the 
weak-points; hopefully without creating new ones); or do nothing, and 
stick with the existing language as-is.

Mostly works OK for both making parts to 3D print and also making basic 
3D models.

Gives a lot of control and ability to edit things, but does depend some 
on thinking and mental math at times.


As noted, in any case, I am not a fan of external dependencies, and 
particularly not large external dependencies.


So, a "new" viewer, if implemented, would probably be a fairly simple 
program to do the CSG and display the result. May or may not have a 
built-in text editor, the other main option being to have a hot-reload key.

May make sense to keep it backwards compatible with SCAD though, which 
leans more towards a modified superset rather than an entirely new language.

[toc] | [prev] | [next] | [standalone]


#401132 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-13 23:44 +0000
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115lksu$22o43$5@dont-email.me>
In reply to#401106
On Thu, 13 Aug 2026 04:37:29 -0500, BGB wrote:

> On 8/13/2026 12:00 AM, Lawrence D’Oliveiro wrote:
>>
>> On Wed, 12 Aug 2026 23:07:35 -0500, BGB wrote:
>>
>>> As for CSG vs mesh modeling:
>>>
>>> CSG: Specifies solid shapes, which is more useful if 3D physics
>>> needs to get involved, or you want to turn it into something you
>>> can 3D print.
>>>
>>> Meshes: More popular/traditional for 3D graphics, and more easily
>>> achieves natural shapes. But, worse suited to any sort of physical
>>> simulation, particularly if using non-closed meshes.
>>
>> Blender has both.
>
> I wouldn't want to make things dependent on Blender...

It’s open source. The copyright is owned by a nonprofit foundation.
There’s no legal way that it could be swallowed up by any for-profit
corporation. You are free to do what you want with the source code.

> Blender is a pretty big / heavyweight tool; and depending on Blender
> and Python is not exactly a small dependency.

Blender is more lightweight than many alternatives, as I already
pointed out. Everybody already has Python on their systems for other
(very good) reasons, why not take advantage of that?

Blender can be run in batch mode, under the control of a script
which feeds it Python code to execute etc.

There is also an option (marked as “experimental” in the Blender
source tree) to build Blender as a set of Python modules.

> Like, my existing pipeline doesn't already depend on Blender, and I
> have no reason to add it as a dependency.

It adds new capabilities you didn’t have before. Where else are you
going to get anything similar?

Here’s an example from the early days of Geometry Nodes
<https://www.youtube.com/watch?v=io_x3IqOndE>: combining a few
hand-modelled pieces to create buildings of arbitrary complexity.

[toc] | [prev] | [next] | [standalone]


#401135 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-13 18:50 -0700
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115ls8d$25dmf$1@dont-email.me>
In reply to#401132
On 8/13/2026 4:44 PM, Lawrence D’Oliveiro wrote:
[...]

Blender is pretty nice. But, its a bit large. Anyway, matter not in a 
sense. Its a tool. And it fun to program in Python for it.

[toc] | [prev] | [next] | [standalone]


#401138 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-14 02:41 +0000
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115lv8g$2639l$2@dont-email.me>
In reply to#401135
On Thu, 13 Aug 2026 18:50:05 -0700, Chris M. Thomasson wrote:

> Blender is pretty nice. But, its a bit large.

It’s a lot smaller download than Autodesk Maya or proprietary
alternatives like that.

> Anyway, matter not in a sense. Its a tool. And it fun to program in
> Python for it.

I would say it caters to both sides of the brain -- artistic and
technical. Skill in CG depends on a lot on developing capacity in
both.

[toc] | [prev] | [next] | [standalone]


#401144 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromBGB <cr88192@gmail.com>
Date2026-08-13 23:47 -0500
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115m6u3$285f3$1@dont-email.me>
In reply to#401138
On 8/13/2026 9:41 PM, Lawrence D’Oliveiro wrote:
> On Thu, 13 Aug 2026 18:50:05 -0700, Chris M. Thomasson wrote:
> 
>> Blender is pretty nice. But, its a bit large.
> 
> It’s a lot smaller download than Autodesk Maya or proprietary
> alternatives like that.
> 

Better not to poke those with a stick IMO.

They are specially designed to try to create vendor lock-in and then 
trick people into paying subscriptions to keep using the software; not 
worth it.


>> Anyway, matter not in a sense. Its a tool. And it fun to program in
>> Python for it.
> 
> I would say it caters to both sides of the brain -- artistic and
> technical. Skill in CG depends on a lot on developing capacity in
> both.

Yes, but still doesn't mean one wants to create a hard dependency on 
Blender or Python...


Like, if you want a shovel...

It doesn't matter that a Backhoe is smaller and cheaper than an  Excavator.

...


Sometimes, one just wants a few tools:
A tool that converts a language to a 3D model in a specified format via 
a command-like or text-script so that it can be packaged up in some 
asset format (or output geometry as STL or "Wavefront OBJ" or similar);
Another tool that allows viewing the 3D model, and launches quickly and 
doesn't require dealing with some cumbersome file selector dialog and 
import UI and similar;
...


Like, you might just want to be like:
Make tool;
Associate file extension with tool;
Double click;
Done, view file;
Close program when done looking at model, or have a reload hot-key for 
when one wants to edit the file (via something like Notepad).


Or, say, like "Windows Photo Viewer" vs GIMP. Even if both have "open a 
photo and look at it" as features, they are still not really the same 
thing. Both serve very different roles in terms of purpose and UX.

Or, by extension, "Microsoft 3D Viewer" vs Blender.
   3D Viewer likely being a closer analogy, but more obscure.


And, no big central "do everything" programs needed or desired in many 
cases...

Doesn't mean the big central program can't have it as well, but assuming 
the big central program is the end-all be-all, is seriously missing the 
point.

[toc] | [prev] | [next] | [standalone]


#401146 — Re: Quaternions (was Re: Default signedness of 'plain' char.)

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-14 04:59 +0000
SubjectRe: Quaternions (was Re: Default signedness of 'plain' char.)
Message-ID<115m7b7$285tt$1@dont-email.me>
In reply to#401144
On Thu, 13 Aug 2026 23:47:27 -0500, BGB wrote:

> On 8/13/2026 9:41 PM, Lawrence D’Oliveiro wrote:
>>
>> On Thu, 13 Aug 2026 18:50:05 -0700, Chris M. Thomasson wrote:
>>
>>> Blender is pretty nice. But, its a bit large.
>>
>> It’s a lot smaller download than Autodesk Maya or proprietary
>> alternatives like that.
>
> Better not to poke those with a stick IMO.
>
> They are specially designed to try to create vendor lock-in and then
> trick people into paying subscriptions to keep using the software;
> not worth it.

They’re also specialist tools. They’ve given up being a complete
workflow solution. So you need to spend even more money buying even
more tools to get work done.

No, they are not in a position to compete with open-source tools. All
they’ve got is a multi-million-dollar publicity budget to tell
everyone how wonderful they are. So they cater to those who are
willing to swallow such things, and that’s enough to make them even
more rich. They don’t need any more.

>>> Anyway, matter not in a sense. Its a tool. And it fun to program in
>>> Python for it.
>>
>> I would say it caters to both sides of the brain -- artistic and
>> technical. Skill in CG depends on a lot on developing capacity in
>> both.
>
> Yes, but still doesn't mean one wants to create a hard dependency on
> Blender or Python...

The open-source world makes heavy use of code reuse. That’s why it’s
such a productive place to be.

You’re still thinking in Windows terms, aren’t you? Where everything
has to be downloaded individually and installed manually, there is no
integrated package manager to deal with the details for you.

> Sometimes, one just wants a few tools:
> A tool that converts a language to a 3D model in a specified format
> via a command-like or text-script so that it can be packaged up in
> some asset format (or output geometry as STL or "Wavefront OBJ" or
> similar); Another tool that allows viewing the 3D model, and
> launches quickly and doesn't require dealing with some cumbersome
> file selector dialog and import UI and similar; ...

All doable.

[toc] | [prev] | [next] | [standalone]


#401026

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-11 13:47 -0700
Message-ID<115g1p6$aeop$2@dont-email.me>
In reply to#400995
On 8/11/2026 8:17 AM, James Kuyper wrote:
> On 2026-08-10 21:44, BGB wrote:
>> On 8/10/2026 7:03 PM, James Kuyper wrote:
>>> On 2026-08-10 18:31, BGB wrote:
>>> ...> Snipped section included my epic fail at trying to use traditional
>>> style
>>>> mathematical notation in a Usenet post...
>>>>
>>>> It was bugging me, by implying the conjugate was a scalar, where no, the
>>>> conjugate is not a scalar...
>>>
>>> I'm not sure what you're saying. As far as C is concerned. complex types
>>> are floating types (6.2.5p15), and therefore arithmetic types
>>> (6.2.5p23), and therefore scalar types (6.2.5p26) Therefore, a function
>>> that returns the conjugate of its argument would return a scalar type.
>>
>> I wrote:
>>     R^-1 = (R.r-R.i-R.j-R.k) / (R.r*R.r + R.i*R.i + R.j*R.j + R.k*R.k)
>>
>> The problem:
>>     (R.r-R.i-R.j-R.k)
>> Should have been, say:
>>     (R.r - R.i*I - R.j*J - R.k*K)
>>
>> Which was bugging me, because either the former would be interpreted as
>> meaning a scalar (or real-valued) result, or "R.i*R.i" as being
>> negative, neither of which was true in the intended expression...
> 
> I was confused because you were writing about complex numbers, mentioned
> that you had snipped some material, and then made a comment that I
> assumed, from context, was also about complex numbers. I did not realize
> that there was a context switch to quaternions inside the snipped material.
> In the unlikely event that that were added to C, quaternions would
> almost certainly be added as a new arithmetic (and therefore, scalar)
> type, by analogy with the complex types. I was unaware, until just now
> when I looked it up, that the real part of a quaternion is often
> referred to as it's scalar part.
> That's a little odd, because I'm one of the probably very few people
> here who've actually made practical use of quaternions. I had to deal
> with data about spacecraft orientation that was stored as a quaternion,
> and convert between quaternions and corresponding Euler angles and
> Rotation matrices. However, a quaternion library was part of the
> standard toolkit for that project, which makes sense.

quaternion are very useful for such things. Avoiding gimbal lock?

[toc] | [prev] | [next] | [standalone]


#401145

FromBGB <cr88192@gmail.com>
Date2026-08-13 23:50 -0500
Message-ID<115m73a$285f3$2@dont-email.me>
In reply to#401026
On 8/11/2026 3:47 PM, Chris M. Thomasson wrote:
> On 8/11/2026 8:17 AM, James Kuyper wrote:
>> On 2026-08-10 21:44, BGB wrote:
>>> On 8/10/2026 7:03 PM, James Kuyper wrote:
>>>> On 2026-08-10 18:31, BGB wrote:
>>>> ...> Snipped section included my epic fail at trying to use traditional
>>>> style
>>>>> mathematical notation in a Usenet post...
>>>>>
>>>>> It was bugging me, by implying the conjugate was a scalar, where 
>>>>> no, the
>>>>> conjugate is not a scalar...
>>>>
>>>> I'm not sure what you're saying. As far as C is concerned. complex 
>>>> types
>>>> are floating types (6.2.5p15), and therefore arithmetic types
>>>> (6.2.5p23), and therefore scalar types (6.2.5p26) Therefore, a function
>>>> that returns the conjugate of its argument would return a scalar type.
>>>
>>> I wrote:
>>>     R^-1 = (R.r-R.i-R.j-R.k) / (R.r*R.r + R.i*R.i + R.j*R.j + R.k*R.k)
>>>
>>> The problem:
>>>     (R.r-R.i-R.j-R.k)
>>> Should have been, say:
>>>     (R.r - R.i*I - R.j*J - R.k*K)
>>>
>>> Which was bugging me, because either the former would be interpreted as
>>> meaning a scalar (or real-valued) result, or "R.i*R.i" as being
>>> negative, neither of which was true in the intended expression...
>>
>> I was confused because you were writing about complex numbers, mentioned
>> that you had snipped some material, and then made a comment that I
>> assumed, from context, was also about complex numbers. I did not realize
>> that there was a context switch to quaternions inside the snipped 
>> material.
>> In the unlikely event that that were added to C, quaternions would
>> almost certainly be added as a new arithmetic (and therefore, scalar)
>> type, by analogy with the complex types. I was unaware, until just now
>> when I looked it up, that the real part of a quaternion is often
>> referred to as it's scalar part.
>> That's a little odd, because I'm one of the probably very few people
>> here who've actually made practical use of quaternions. I had to deal
>> with data about spacecraft orientation that was stored as a quaternion,
>> and convert between quaternions and corresponding Euler angles and
>> Rotation matrices. However, a quaternion library was part of the
>> standard toolkit for that project, which makes sense.
> 
> quaternion are very useful for such things. Avoiding gimbal lock?

Among other things:
No gimbal lock;
Can LERP/SLERP;
SLERP'ing between identity and a given rotation allows scaling the rotation;
Can be used as a vector for angular velocity or angular inertia math;
Can be multiplied for compound rotations (like with matrix math);

Try to SLERP a matrix, and it may "rubber band" or have other weird 
glitches;
Try to LERP Euler angles and the motion may end up going in some totally 
weird direction;
...

If you use two of them (a "dual quaternion"), it is possible to express 
fairly arbitrary transforms (translation + rotation).

Like, were pretty useful for doing something like a rigid-body physics 
engine, even if the physics engine itself turned out to not be very useful.

[toc] | [prev] | [next] | [standalone]


#401148

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-14 05:59 +0000
Message-ID<115masb$294v7$1@dont-email.me>
In reply to#401145
On Thu, 13 Aug 2026 23:50:16 -0500, BGB wrote:

> SLERP'ing between identity and a given rotation allows scaling the
> rotation;

You can’t linearly interpolate the sines and cosines, though. If you
want to do linear interpolation of the rotation angle, don’t you have
to compute inverse sines/cosines, calculate new angles and then back
again?

[toc] | [prev] | [next] | [standalone]


#401153

FromBGB <cr88192@gmail.com>
Date2026-08-14 03:16 -0500
Message-ID<115mj6i$2ccfd$1@dont-email.me>
In reply to#401148
On 8/14/2026 12:59 AM, Lawrence D’Oliveiro wrote:
> On Thu, 13 Aug 2026 23:50:16 -0500, BGB wrote:
> 
>> SLERP'ing between identity and a given rotation allows scaling the
>> rotation;
> 
> You can’t linearly interpolate the sines and cosines, though. If you
> want to do linear interpolation of the rotation angle, don’t you have
> to compute inverse sines/cosines, calculate new angles and then back
> again?

This is where it can get funny:
While naive interpolation goes off the unit-sphere, re-normalizing the 
quaternion generally puts it back at around the position it would have 
been had one followed an arc over the surface of the hyper-sphere 
between these points (at least within +/- 180 degrees, and not 
necessarily at a uniform velocity if the distance is large).

This is both more convenient and cheaper than using sines or cosines or 
trying to follow an arc. One can use them, but don't need to.

More accuracy (and more uniform speed) is possible with a normalized 
LERP though by using a subdivision trick similar to that used for 
matrices if the points are further apart, though in this case it is a 
little cheaper, say:
qnlerp(A,B,f)
   if(qdist2(A,B)<CUTOFF)
     return qnormalize(A*(1-f)+(B+f));
   C=qnormalize((A+B)*0.5);
   if(frac<0.5)
     return qnlerp(A,C,f*2);
   return qnlerp(C,B,f*2-1);


Though, they still come up if moving to/from axis/angle or similar.

As can be noted, multiplying rotations also effectively concatenates them.

Can't really explain how it works...

Granted, there are some weird cases that need to be worked around, but 
mostly it all "just sorta works"...

[toc] | [prev] | [next] | [standalone]


#401154

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-14 08:32 +0000
Message-ID<115mjrm$2ccfb$2@dont-email.me>
In reply to#401153
On Fri, 14 Aug 2026 03:16:02 -0500, BGB wrote:

> On 8/14/2026 12:59 AM, Lawrence D’Oliveiro wrote:
>>
>> On Thu, 13 Aug 2026 23:50:16 -0500, BGB wrote:
>>
>>> SLERP'ing between identity and a given rotation allows scaling the
>>> rotation;
>>
>> You can’t linearly interpolate the sines and cosines, though. If
>> you want to do linear interpolation of the rotation angle, don’t
>> you have to compute inverse sines/cosines, calculate new angles and
>> then back again?
>
> This is where it can get funny:
> While naive interpolation goes off the unit-sphere, re-normalizing
> the quaternion generally puts it back at around the position it
> would have been had one followed an arc over the surface of the
> hyper-sphere between these points (at least within +/- 180 degrees,
> and not necessarily at a uniform velocity if the distance is large).
>
> This is both more convenient and cheaper than using sines or cosines
> or trying to follow an arc. One can use them, but don't need to.

Ha! Thanks for that.

I was thinking in terms of inverting the formula for the quaternion
for double the angle to get the one for half the angle. Probably
involve square roots, which is still less computation than trig.

After our previous exchange on quaternions, I was doing some
experiments in Blender to see if I could patch up near-full-circle
rotations in the wrong direction just by fiddling the quaternions, not
by adding more key frames. Negating the W (cosine) component does flip
the rotation direction, but the in-between rotation rate can go a bit
wild unless you tweak one or two of the other components (i.e.
contributions to the sine component) as well.

> As can be noted, multiplying rotations also effectively concatenates
> them.
>
> Can't really explain how it works...

First of all, a quaternion consists of a vector (X, Y, Z) and scalar
(W) part. The direction of the vector part gives the rotation axis,
while its magnitude gives the sine of the half angle. The scalar part
is the cosine of the half angle.

Applying a rotation to a vector involves multiplying the quaternion by
the vector. If this is just a special case of rotating a quaternion
(i.e. nonzero scalar part), then it probably follows from that ...

[toc] | [prev] | [next] | [standalone]


#401170

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-14 12:36 -0700
Message-ID<115nqns$2q726$1@dont-email.me>
In reply to#401148
On 8/13/2026 10:59 PM, Lawrence D’Oliveiro wrote:
> On Thu, 13 Aug 2026 23:50:16 -0500, BGB wrote:
> 
>> SLERP'ing between identity and a given rotation allows scaling the
>> rotation;
> 
> You can’t linearly interpolate the sines and cosines, though. If you
> want to do linear interpolation of the rotation angle, don’t you have
> to compute inverse sines/cosines, calculate new angles and then back
> again?

To interpolate the rotation angle? Something simple, linear:

// typed in the newsreader sorry for any typos

________________________
unsigned long n = 42; // granularity and iter all in one...

float angle_min = 0;
float angle_max = PI/2;
float angle_dif = angle_max - angle_min;

float normal_base = 1.f/n

for (unsigned long i = 0; i < n; ++i)
{
     float normal = normal_base * i;
     float angle = angle_min + angle_dif * normal;

     float x0 = cos(angle);
     float y0 = sin(angle);

     // (x0, y0) as normalized here

     // render line from (0, 0) to (x0, y0)...
}
________________________

Now, this missed normal equaling 1 during iteration... We can do two 
things here if that is in your requirements. Alter the base, or over 
iterate by one. The prior needs to resist division by zero.

float normal_base = (n > 1) ? 1.f/(n-1) : 0.f;
for (unsigned long i = 0; i < n; ++i) { ... }


vs...

float normal_base = 1.f/n;
for (unsigned long i = 0; i <= n; ++i) { ... }

One of the methods over extend i such that i can equal n. Beware of that 
in case you are using i to index into an array or something...

So, we need to ponder on the i-1 for the normal_base, or the over 
iterate if we want normal in the loop to reach angle_max. Fair enough?

;^)

[toc] | [prev] | [next] | [standalone]


#401195

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-15 03:16 +0000
Message-ID<115olmm$31q4n$1@dont-email.me>
In reply to#401170
On Fri, 14 Aug 2026 12:36:25 -0700, Chris M. Thomasson wrote:

> float angle_min = 0;
> float angle_max = PI/2;
> float angle_dif = angle_max - angle_min;
>
> float normal_base = 1.f/n
>
> for (unsigned long i = 0; i < n; ++i)
> {
>      float normal = normal_base * i;
>      float angle = angle_min + angle_dif * normal;
>
>      float x0 = cos(angle);
>      float y0 = sin(angle);
>
>      // (x0, y0) as normalized here
>
>      // render line from (0, 0) to (x0, y0)...
> }

But the quaternion doesn’t directly give you the angle to begin with,
you will need to do an inverse trig computation to get it. And then do
the above trig calls for every segment.

I just wondered if there was a way to go straight from cos/sin of an
angle to cos/sin of fractions of that angle ... I think there is.

[toc] | [prev] | [next] | [standalone]


#401200

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-14 22:38 -0700
Message-ID<115ou0u$33pc0$2@dont-email.me>
In reply to#401195
On 8/14/2026 8:16 PM, Lawrence D’Oliveiro wrote:
> On Fri, 14 Aug 2026 12:36:25 -0700, Chris M. Thomasson wrote:
> 
>> float angle_min = 0;
>> float angle_max = PI/2;
>> float angle_dif = angle_max - angle_min;
>>
>> float normal_base = 1.f/n
>>
>> for (unsigned long i = 0; i < n; ++i)
>> {
>>       float normal = normal_base * i;
>>       float angle = angle_min + angle_dif * normal;
>>
>>       float x0 = cos(angle);
>>       float y0 = sin(angle);
>>
>>       // (x0, y0) as normalized here
>>
>>       // render line from (0, 0) to (x0, y0)...
>> }
> 
> But the quaternion doesn’t directly give you the angle to begin with,
> you will need to do an inverse trig computation to get it. And then do
> the above trig calls for every segment.

Or start from the angles and create a quat?


> I just wondered if there was a way to go straight from cos/sin of an
> angle to cos/sin of fractions of that angle ... I think there is.

Depends on what angles you are looking for?

[toc] | [prev] | [next] | [standalone]


#401225

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-16 00:08 +0000
Message-ID<115qv1q$3pn7u$5@dont-email.me>
In reply to#401200
On Fri, 14 Aug 2026 22:38:37 -0700, Chris M. Thomasson wrote:

> Or start from the angles and create a quat?

You mean, carry the angle around as a separate quantity, in addition
to the quaternion representing i?

> Depends on what angles you are looking for?

The angle represented by the quaternion.

[toc] | [prev] | [next] | [standalone]


#401168

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-08-14 12:17 -0700
Message-ID<115npl5$2prg5$1@dont-email.me>
In reply to#401145
On 8/13/2026 9:50 PM, BGB wrote:
> On 8/11/2026 3:47 PM, Chris M. Thomasson wrote:
>> On 8/11/2026 8:17 AM, James Kuyper wrote:
>>> On 2026-08-10 21:44, BGB wrote:
>>>> On 8/10/2026 7:03 PM, James Kuyper wrote:
>>>>> On 2026-08-10 18:31, BGB wrote:
>>>>> ...> Snipped section included my epic fail at trying to use 
>>>>> traditional
>>>>> style
>>>>>> mathematical notation in a Usenet post...
>>>>>>
>>>>>> It was bugging me, by implying the conjugate was a scalar, where 
>>>>>> no, the
>>>>>> conjugate is not a scalar...
>>>>>
>>>>> I'm not sure what you're saying. As far as C is concerned. complex 
>>>>> types
>>>>> are floating types (6.2.5p15), and therefore arithmetic types
>>>>> (6.2.5p23), and therefore scalar types (6.2.5p26) Therefore, a 
>>>>> function
>>>>> that returns the conjugate of its argument would return a scalar type.
>>>>
>>>> I wrote:
>>>>     R^-1 = (R.r-R.i-R.j-R.k) / (R.r*R.r + R.i*R.i + R.j*R.j + R.k*R.k)
>>>>
>>>> The problem:
>>>>     (R.r-R.i-R.j-R.k)
>>>> Should have been, say:
>>>>     (R.r - R.i*I - R.j*J - R.k*K)
>>>>
>>>> Which was bugging me, because either the former would be interpreted as
>>>> meaning a scalar (or real-valued) result, or "R.i*R.i" as being
>>>> negative, neither of which was true in the intended expression...
>>>
>>> I was confused because you were writing about complex numbers, mentioned
>>> that you had snipped some material, and then made a comment that I
>>> assumed, from context, was also about complex numbers. I did not realize
>>> that there was a context switch to quaternions inside the snipped 
>>> material.
>>> In the unlikely event that that were added to C, quaternions would
>>> almost certainly be added as a new arithmetic (and therefore, scalar)
>>> type, by analogy with the complex types. I was unaware, until just now
>>> when I looked it up, that the real part of a quaternion is often
>>> referred to as it's scalar part.
>>> That's a little odd, because I'm one of the probably very few people
>>> here who've actually made practical use of quaternions. I had to deal
>>> with data about spacecraft orientation that was stored as a quaternion,
>>> and convert between quaternions and corresponding Euler angles and
>>> Rotation matrices. However, a quaternion library was part of the
>>> standard toolkit for that project, which makes sense.
>>
>> quaternion are very useful for such things. Avoiding gimbal lock?
> 
> Among other things:
> No gimbal lock;
> Can LERP/SLERP;
> SLERP'ing between identity and a given rotation allows scaling the 
> rotation;
> Can be used as a vector for angular velocity or angular inertia math;
> Can be multiplied for compound rotations (like with matrix math);
> 
> Try to SLERP a matrix, and it may "rubber band" or have other weird 
> glitches;
> Try to LERP Euler angles and the motion may end up going in some totally 
> weird direction;
> ...
> 
> If you use two of them (a "dual quaternion"), it is possible to express 
> fairly arbitrary transforms (translation + rotation).
> 
> Like, were pretty useful for doing something like a rigid-body physics 
> engine, even if the physics engine itself turned out to not be very useful.
> 
> 

Its interesting. Fwiw, I can get all of the bone matrices to work in my 
shaders without using quaternion. But, that just the way I coded it up. 
List animations, play them, etc. In my experimental engine. Have you 
taken a look at the assimp lib yet? Oh its helps!

Iirc, GLM has a glm::quat... :^)

Note it, read it, want it... ;^D

https://github.com/g-truc/glm

[toc] | [prev] | [next] | [standalone]


#400980

Fromcross@spitfire.i.gajendra.net (Dan Cross)
Date2026-08-11 13:46 +0000
Message-ID<115f93u$plo$1@reader1.panix.com>
In reply to#400957
In article <115dot7$3ihmr$1@dont-email.me>,
James Kuyper  <jameskuyper@alumni.caltech.edu> wrote:
>On 2026-08-10 18:31, BGB wrote:
>...> Snipped section included my epic fail at trying to use traditional
>style
>> mathematical notation in a Usenet post...
>> 
>> It was bugging me, by implying the conjugate was a scalar, where no, the 
>> conjugate is not a scalar...
>
>I'm not sure what you're saying. As far as C is concerned.

Was it not clear to you that he was referring to the definition
of a complex conjugate, in the mathematical sense?

The conjugate of a complex number is also a complex number, and
it is common in elementary mathematics to regard such numbers as
a vector (specifically a pair) consisting of a real component,
and an imaginary component.  Some other fields think of complex
numbers as scalars, but I would expect the person you replied to
to think of a complex number z=a+bi as an ordered pair, <a,b>,
where a,b are real numbers and where "a" is the value of the
real component, and "b" is the (real) factor of the imaginary
component.  The complex conjugate of z is then z*=a-bi=<a,-b>,
is also a vector.

This is totally independent of how C defines things; because C
defines its complex type as a "scalar type" does not mean that
in the mathematical sense, complex numbers cannot be thought of
as vectors.  Besides, math was here first.

>complex types
>are floating types (6.2.5p15), and therefore arithmetic types
>(6.2.5p23), and therefore scalar types (6.2.5p26) Therefore, a function
>that returns the conjugate of its argument would return a scalar type.

This is exactly the danger of an overly pedantic reading: it
leads to attempts to apply one's knowledge of some domain
(such as C) to things outside that domain (such as mathematics).
Being overly rigid in one's thinking and interpretations is not
a sign of expertise, but rather, of the inability to abstract
appropriately.

	- Dan C.

[toc] | [prev] | [next] | [standalone]


Page 5 of 7 — ← Prev page 1 2 3 4 [5] 6 7  Next page →

Back to top | Article view | comp.lang.c


csiph-web