r/GraphicsProgramming • • Feb 16 '26

Constellation: Sharing Cadent Geometry (Avoiding normalization + geometry derived physics)

https://github.com/Mauitron/Cadent_Geometry

Hi!

I am going to be short:

For the first time, I am sharing a bit of code that I developed for my Rust no-std graphics engine. That is not entirely true, the code itself started as my solution for not having to normalize vectors. An attempt to have a unified unit to express everything. Turns out ended up building a geometry, which makes it more than just being a 'solution' for my engine. I am calling this geometry 'Cadent Geometry'. Cadent geometry is a internally consistent, and is thoroughly tested to be able to accurately close any path thrown at it.

Everything so far can be expressed by one irreducible formula, and one constant. That is all. and because its integer based, it is able to turn individual pixel computation for depth and curvature into 1 multiplication, and 1 bitshift.

many things such as gravity or acceleration also falls out from the geometry itself. So not only don't you have to normalize vectors, things like jumping becomes an emergent behavior of the world rather than being a separate system.

I am going to stop yapping. the link above leads to the no-std definition of said geometry.

I hope you find it interesting!

//Maui_the_Mammal says bye bye!

14 Upvotes

27 comments sorted by

View all comments

Show parent comment

2

u/Maui-The-Magificent Feb 16 '26

Ah good intuition! You could view it like that to make it easier to visualize, It is a very useful mental model, that is mostly correct! Velocity and gravity is the result of adding the time circle. But it is not exactly there is some nuance.

the spatial topology of cadent is a flat torus, with an added time circle, but more importantly, it lives in arc space. Coordinates need distance, and distance does not exist in arc space, its only angles. you could impose distance upon it, but it is not a primitive, if that make sense?

But you are not wrong either. To quickly clarify: the 'meter' is relative in cadent, each object is a cadent universe has a spatial resolution of 2^128. so the camera and the planet in the images has the same spatial resolution, so the planet meter is defined as the scale difference between them.

After applying the drop formula, you are left with (in the planet sized examples on the github) around 440 billion coordinates per planet meter, that are also angles and directions.

Just as a bonus tidbit. Afun effect this has is that in a cadent universe, the distance from earth to jupiter is longer than the distance from jupiter to earth. Because jupiters 'meter' would be much much larger than earths 'meter' xD