top of page

Ideas Portal

Hopping from one bulb to another...

M2023 - Fourier Series : World Space & Local Space

  • Writer: XR_XharpRazor
    XR_XharpRazor
  • 1 day ago
  • 3 min read

Abstract


A few weeks ago, I created a tool to demonstrate the beauty of Fourier Series.

This is a combination of Math and Art



fOwOrier Sewies : one of the presets "spike flower", with a modification of "f0 = 22.5" instead of "f0 = 30"
fOwOrier Sewies : one of the presets "spike flower", with a modification of "f0 = 22.5" instead of "f0 = 30"

Core


here is a small "problem"


<! WARNING !>

frequencies given in the harmonic configuration should be in LOCAL SPACE


This means every time you see a preset on YouTube Shorts or TikTok, you cannot immediately copy and paste the given configurations exactly.

A little bit of processing needs to be done



World Space and Local Space Introduction


World space means that

the rotation of the radii are relative to your screen


Local space means that

the rotation of a radius is relative to its previous radius


ree


Before we dive deeper, let's define a few notations :


F[n]

Frequency of the nth radius in World Space


f[n]

Frequency of the nth radius in Local Space




Here is an example to differentiate World Space and Local Space Rotation :

Assume that we have the following harmonics


frequency (deg/s)

phase (deg)

amplitude

R[0]

360

0

1

R[1]

0

0

1

R[2]

0

0

1

R[3]

0

0

1

if this is in WORLD SPACE :

R[0] will be spinning only

R[1], R[2], R[3] will be pointing to the right

you will end up with a circle on the right


if this is in LOCAL SPACE (which fOwOrier Sewies is in)

R[0] will cause R[1] and R[2] and R[3] to spin

and you will end up with a huge circle


in other words, in LOCAL SPACE

when a radius R[n] rotates, it will cause all other radii R[m] where n<m



here's how conversion between World Space and Local Space is done, let's start with Local Space to World Space convertion


assume that we have the following frequencies



f[0] = 45

f[1] = -720

f[2] = 360

f[3] = 720

R[0]





R[1]





R[2]





R[3]






F[0] = ???

F[1] = ???

F[2] = ???

F[3] = ???

here we can see that R[0] will spin the rest for 45 deg


f[0] = 45

f[1] = -720

f[2] = 360

f[3] = 720

R[0]

45

45

45

45

R[1]





R[2]





R[3]






F[0] = ???

F[1] = ???

F[2] = ???

F[3] = ???

R[1] will spin for -720 for R[1], R[2], and R[3]



f[0] = 45

f[1] = -720

f[2] = 360

f[3] = 720

R[0]

45

45

45

45

R[1]


-720

-720

-720

R[2]





R[3]






F[0] = ???

F[1] = ???

F[2] = ???

F[3] = ???

R[2] will spin for 360 for R[2] and R[3]



f[0] = 45

f[1] = -720

f[2] = 360

f[3] = 720

R[0]

45

45

45

45

R[1]


-720

-720

-720

R[2]



360

360

R[3]






F[0] = ???

F[1] = ???

F[2] = ???

F[3] = ???


and R[3] will spin for 720 for its own



f[0] = 45

f[1] = -720

f[2] = 360

f[3] = 720

R[0]

45

45

45

45

R[1]


-720

-720

-720

R[2]



360

360

R[3]




720


F[0] = ???

F[1] = ???

F[2] = ???

F[3] = ???

now we can add all of them up to get their rotation in World Space


f[0] = 45

f[1] = -720

f[2] = 360

f[3] = 720

R[0]

45

45

45

45

R[1]


-720

-720

-720

R[2]



360

360

R[3]




720


F[0] = 45

F[1] = -675

F[2] = -315

F[3] = 405

take R[2] and R[3] for example

F[3]

= f[0] + f[1] + f[2] + f[3]

= F[2] + f[3]


take R[1] and R[2] for example

F[2]

= f[0] + f[1] + f[2]

= F[1] + f[2]


from these two examples, we can see that for a World Space Freq, it contains it's previous term and it's current Local Space Freq, or in other words :


if 0 < n : F[n] = F[n-1] + f[n]

if n == 0 : F[0] = f[0]


this is the key of World Space and Local Space conversion



Pros and Cons

WORLD SPACE

LOCAL SPACE

you can arrange radii however you like, order doesn't matter

radius are in a hierarchical structure, order matters

harder pattern discovery

pattern discovery is easier, often you just need to change one frequency and you can end up with another decent pattern

the popular convention that the Math community and internet uses

fOwOrier Sewies uses this, can be implemented in Game Engines since Game Engines has Hiearchy for Game Objects.


and as a wrapping point, here is a final example :



f[0] = 30

f[1] = -360

f[2] = 720

f[3] = 360

R[0]

30

30

30

30

R[1]


-360

-360

-360

R[2]



720

720

R[3]




360


F[0] = 30

F[1] = -330

F[2] = 390

F[3] = 750


fOwOrier Sewies is actually first implemented in VRChat (Unity) first, then it got converted to javascript
fOwOrier Sewies is actually first implemented in VRChat (Unity) first, then it got converted to javascript

Recent Posts

See All
m^2 + 7m + 49 = 0 , m^3 = ?

for starters, we can have the following quick and clean way m^2 + 7m + 49 = 0 m^3 + 7m^2 + 49m = 0 and since m^2 + 7m + 49 = 0 m^2 = -7m...

 
 
 

Comments


bottom of page