ganja.js icon indicating copy to clipboard operation
ganja.js copied to clipboard

Modeling a toroidal space

Open YPares opened this issue 4 years ago • 6 comments

Hello, I'm trying to think about using GA to model a 2D toroidal space, ie. a positively-curved space, which loops on itself in the two dimensions.

I'm wondering whether ganja is able to model such a geometry? Also, I'd like to decorrelate that space from the on-screen representation, as I'd like to have several of them ("flattened" 2D representation, torus in 3D space, 2D slices of the torus (so succession of circles) etc). Is it possible to easily convert from these spaces/takes slices of them with ganja so as to have an internal, visualization-agnostic space which then gets translated to, say, a 3DPGA representation more readily drawable by the computer?

YPares avatar Jun 16 '20 10:06 YPares

Sounds like Mario World

William Gacquer

Le 16 juin 2020 à 12:04, Yves Parès [email protected] a écrit :

 Hello, I'm trying to think about using GA to model a 2D toroidal space, ie. a positively-curved space, which loops on itself in the two dimensions.

I'm wondering whether ganja is able to model such a geometry? Also, I'd like to decorrelate that space from the on-screen representation, as I'd like to have several of them ("flattened" 2D representation, torus in 3D space, 2D slices of the torus (so succession of circles) etc). Is it possible to easily convert from these spaces/takes slices of them with ganja so as to have an internal model which then gets translated to, say, a 3DPGA representation more readily drawable by the computer?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

citron avatar Jun 16 '20 10:06 citron

A bit :) But it's actually not for video games but for experiments in procedural generation of loops in music. Lines in that space would be notes, and I have an extra line which is my "track" (containing a special point which is the starting point): every time the track line crosses one of the note lines, that's a note event. The distance between my starting point and the crossing point tells at which time the note should be played. My track is a straight line, but since the space itself is curved, my "track" is actually a geodesic of the torus, which "spirals" over it. Technically, both dimensions of my torus space are time. The first dimension curvature (the "thickness" of the torus) is set to define the length in time of a musical bar (the less curved the dimension, the longer the bars), and the second dimension curvature (the "perimeter" of the torus) defines the length of the full musical loop (before it starts over again). So, technically there'd be an extra dimension for the pitch (and my note lines and track line would actually be planes), but that one has zero curvature [1], and I'm gonna start simple with just one-note rhythms and generalize after.

I know that GA can handle spaces of any metric, but not if ganja is able to do so and what should be done in order to have it aware of this positive curvature.

[1] Though pitch dimension could be positively curved too for instance to model just one octave. But let's first consider it a flat dimension of positive real numbers just representing the base note frequency.

YPares avatar Jun 16 '20 11:06 YPares

Funny because I did the same a few years ago.

William Gacquer

Le 16 juin 2020 à 13:59, Yves Parès [email protected] a écrit :

 A bit :) It's actually not for video games but for experiments in procedural music generation.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

citron avatar Jun 16 '20 17:06 citron

@citron Really? :) Do you have the code somewhere?

YPares avatar Jun 16 '20 18:06 YPares

yes, but that was for an iPad application that never went public because Apple changed the "webview" usage rules. I'll convert it and post it on my github pages ( in august ).

Le mar. 16 juin 2020 à 20:07, Yves Parès [email protected] a écrit :

@citron https://github.com/citron Really? :) Do you have the code somewhere?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/enkimute/ganja.js/issues/88#issuecomment-644923336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHMV4T3X72TYIYA5AU5CDRW6YEPANCNFSM4N7OW6EA .

-- William Gacquer

citron avatar Jun 28 '20 13:06 citron

Thanks! So do you think ganja would be suitable for what I try to do? I'm not sure of where to start...

YPares avatar Jun 29 '20 16:06 YPares