Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active September 25, 2024 10:50
Show Gist options
  • Save coderofsalvation/cf502fb11633a2aa666c55099a958a7e to your computer and use it in GitHub Desktop.
Save coderofsalvation/cf502fb11633a2aa666c55099a958a7e to your computer and use it in GitHub Desktop.
SuperShape MimeType + FileType Specification 0.1

3D Supershape FileFormat

  • fileformat: textual comma-separated floats
  • file extension: .ss3d ss2d
  • mimetype: model/supershape3D, model/supershape2D


render of values 7,1,1,20.45,-0.33,-3.54,6,1,1,-0.96,4.46,0.52,200

more examples/formula: https://web.archive.org/web/20240417041832/https://paulbourke.net/geometry/supershape/

URI Example

<!-- HTML -->
<img src="box.ss3d"/>
<img src="data:model/supershape3D,1,1,1,77,0.81,71.7,8,1,1,0.63,2.92,0.24,200"/>

XR Fragment 'extra' in .glb, .fbx, .usdz file:

src: 'data:model/supershape3D,1,1,1,77,0.81,71.7,8,1,1,0.63,2.92,0.24,200'

dynamic XR Fragment 'extra' attached to an object inside .glb:

preset1: 'data:model/supershape3D,1,1,1,77,0.81,71.7,8,1,1,0.63,2.92,0.24,200'
preset2: 'data:model/supershape3D,9,1,1,-70,-0.14,77,2,1,1,0.38,4.12,-0.7,200'
preset: '{preset1}'
src: '{preset}'
href: '#preset=preset2

clicking (href) will update supershape to preset2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment