Demonstrate the power of programming via computational environments #94

Open
opened 2026-05-14 10:00:12 +02:00 by utopiah · 13 comments
Owner

Loading individual assets is nice and works (thanks to e.g. #15 ). It is probably how most players are used to creating interesting scenes and thus examples.

This though does not really leverage the computational medium.

Despite the purpose not being to teach programming or computational thinking it is still relying on software as a medium and can thus leverage them.

Some examples could provide environments that leverage that.

Loading individual assets is nice and works (thanks to e.g. #15 ). It is probably how most players are used to creating interesting scenes and thus examples. This though does not really leverage the computational medium. Despite the purpose not being to teach programming or computational thinking it is still relying on software as a medium and can thus leverage them. Some examples could provide environments that leverage that.
utopiah added the Beyond NLNet2025-04 label 2026-05-14 10:00:15 +02:00
Author
Owner

Colored voxel backgrounds, in the sense of being more than 2m away from the player starting point and non-interactable, would be empowering examples.

Colored voxel backgrounds, in the sense of being more than 2m away from the player starting point and non-interactable, would be empowering examples.
Author
Owner

Example https://biggu.benetou.fr/games.html?play=procedural as rainbow coliseum-ish.

image.png image.png

in ~50 lines with few loops.

Example https://biggu.benetou.fr/games.html?play=procedural as rainbow coliseum-ish. <img width="1016" alt="image.png" src="attachments/f5136d56-7cbd-40bb-a6fe-3a6edfd59f42"> <img width="948" alt="image.png" src="attachments/7f3ec86b-abd1-494d-b861-490458488c62"> in ~50 lines with few loops.
1.3 MiB
2.4 MiB
Author
Owner

Note that to be properly interesting in XR it means #90 should be coupled with component and their value, that means being reactive, typically properly supporting the update() functions.

Note that to be properly interesting in XR it means #90 should be coupled with component and their value, that means being reactive, typically properly supporting the `update()` functions.
Author
Owner

Can even be animated this way, e.g.

i=0; setInterval( _ => procedural.setAttribute("procedural", "verticalscaling:"+ Math.sin( i++ ) ), 1000  )
Can even be animated this way, e.g. ```javascript i=0; setInterval( _ => procedural.setAttribute("procedural", "verticalscaling:"+ Math.sin( i++ ) ), 1000 ) ```
Author
Owner

Also showcase how changing just 1 parameter radically changes the visual and thus how one feels in the space :

image.png
Also showcase how changing just 1 parameter radically changes the visual and thus how one feels in the space : <img width="1006" alt="image.png" src="attachments/6df9a22e-a201-47c9-bd9d-c2d13dc97f3e">
1.4 MiB
Author
Owner

Can also use physics, cf #32 e.g. slow rotation and impulse in low gravity on some or most to animate.

Can also use physics, cf #32 e.g. slow rotation and impulse in low gravity on some or most to animate.
Author
Owner

Can rely on https://home.benetou.fr/spirale.html to have a more concentric pattern.

Can rely on https://home.benetou.fr/spirale.html to have a more concentric pattern.
Author
Owner

Animation itself https://aframe.io/docs/1.7.0/components/animation.html without even physics, can help to shape an environment.

It's something prohibitively expensive in non purely digital architecture that becomes usable here.

Animation itself https://aframe.io/docs/1.7.0/components/animation.html without even physics, can help to shape an environment. It's something prohibitively expensive in non purely digital architecture that becomes usable here.
Author
Owner

Much simpler way to showcase the principle :

environment.setAttribute("visible", false)

rainbowColow = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]
rc = rainbowColow.map( (color,cn) => {
	let el = document.createElement("a-torus")
	el.setAttribute("color", color)
	el.setAttribute("rotation", "90 0 0" ) 
	el.setAttribute("position", "y", cn/2 ) 
	el.setAttribute("radius", 2+cn )
	// el.setAttribute("wireframe", "true" ) 
	AFRAME.scenes[0].appendChild(el)
})
image.png
Much simpler way to showcase the principle : environment.setAttribute("visible", false) ```javascript rainbowColow = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"] rc = rainbowColow.map( (color,cn) => { let el = document.createElement("a-torus") el.setAttribute("color", color) el.setAttribute("rotation", "90 0 0" ) el.setAttribute("position", "y", cn/2 ) el.setAttribute("radius", 2+cn ) // el.setAttribute("wireframe", "true" ) AFRAME.scenes[0].appendChild(el) }) ``` <img width="986" alt="image.png" src="attachments/bd875428-87f7-4b09-a780-9cb943bf1118">
1.4 MiB
Author
Owner

For something psychadelic yet compact :

environment.setAttribute("visible", false)

rainbowColow = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]
rc = rainbowColow.map( (color,cn) => {
	let el = document.createElement("a-torus")
	el.setAttribute("color", color)
	el.setAttribute("animation", "property: rotation; from: 0 90 0; to: 0 360 0; loop: true; dir: alternate; dur: " + Math.random()*10000*(1+cn) ) 
	el.setAttribute("radius", 2+cn ) 
	AFRAME.scenes[0].appendChild(el)
})
image.png
For something psychadelic yet compact : ```javascript environment.setAttribute("visible", false) rainbowColow = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"] rc = rainbowColow.map( (color,cn) => { let el = document.createElement("a-torus") el.setAttribute("color", color) el.setAttribute("animation", "property: rotation; from: 0 90 0; to: 0 360 0; loop: true; dir: alternate; dur: " + Math.random()*10000*(1+cn) ) el.setAttribute("radius", 2+cn ) AFRAME.scenes[0].appendChild(el) }) ``` <img width="1045" alt="image.png" src="attachments/f9a0f1af-531c-48e0-adef-348c095460a7">
1.4 MiB
Author
Owner

A good heuristic being to go from the available play space away from it. The further it is, the "crazier" it can be.

Alternatively one could try to "hollow out" the play space, namely randomly add primitives only when they are outside the delimited play space, e.g. when the resulting position has a distance superior to a threshold like 3m.

A good heuristic being to go from the available play space away from it. The further it is, the "crazier" it can be. Alternatively one could try to "hollow out" the play space, namely randomly add primitives only when they are outside the delimited play space, e.g. when the resulting position has a distance superior to a threshold like 3m.
Author
Owner

Relying on a color swatch

image.png
Relying on a color swatch <img width="924" alt="image.png" src="attachments/92cb0d99-d659-49ec-bbe4-2555747e53c0">
460 KiB
Author
Owner

Because this is very light (no external dependencies, very few lines of code) it should be itself explorable in XR offline efficiently. This could be a starting point remix for follow up experience, e.g. a step of selecting the background.

In practice this means :

  • opening this experience
  • exploring with jxr entities different values (ideally via #90 to iterate over ranges)
  • saving the resulting state as remix
  • use that remix as basis
Because this is very light (no external dependencies, very few lines of code) it should be itself explorable in XR offline efficiently. This could be a starting point remix for follow up experience, e.g. a step of selecting the background. In practice this means : - opening this experience - exploring with `jxr` entities different values (ideally via #90 to iterate over ranges) - saving the resulting state as remix - use that remix as basis
utopiah added the Strategic examples label 2026-05-29 14:25:21 +02:00
utopiah removed the Beyond NLNet2025-04 label 2026-05-29 15:34:36 +02:00
Sign in to join this conversation.