Spheres and Sky Domes Package

[Spheres and Sky Domes Package Screenshot]

This package allows you to simply create spheres (initially Fibonacci Spheres) made of points (vertices) and lines (edges). The points and lines can be any entities but the lines should be ones that will scale (shapes or meshes are best).

To get started

Search the community packages for ‘Spheres and Sky Domes’
Drag the example template ‘PlanetMoonAndDomeTemplate’ into a game

Main points

  • Each sphere centers on a locator. You need to add two scripts to this - the first is the SpheresAndSkyDomesScript and the second is the LineMeshScript
  • Each sphere is made up of point templates and line templates
  • A point template is a locator with an entity as a child and that entity should have the pointMeshScript attached
  • A line template is a locator with an entity as a child (it should be centered on the locator and the x axis should be lined up with the locator x axis and that should be the axis that scales.

Editor Properties

  • numSpherePoints - this determines how many points make up the sphere (i.e. how ‘complex’ or round looking it is) more points may cause poor performance.
  • spreadMultiplier - this controls the radius of the sphere
  • pointTemplate - this should be set to a pointTemplate as described above - you can use the examples in the package and duplicate those to adapt.
  • proximityThreshold - in this version of the package, the distance from a point is used to determine if it should be connected to another point. By adjusting this you will end up with more (bigger number) or less (smaller number) lines in your sphere. Tip - If you just want points and no lines you can just set this low.
  • rotationIncrement - there is a very simple ‘OnTick’ function that will just add this rotation each frame. The examples in the package just use small ‘yaw’ values here (the second number). You could of course do much more complex animations
  • percentOfSphereToDraw - starting from the top - how much to draw. e.g. for a sky dome you don’t need to draw the points and lines which are invisible so you could choose a value of 60 (60 percent of the sphere will be drawn). You can rotate the central locator to make the segment be the bottom or the side.
  • lineTemplate - use this to indicate the lineTemplate that will be used as indicated above. Shapes or Meshes that scale nicely on one axis (e.g. laser mesh or cylinder shapes) work best in general.
  • lineMeshLength - this indicates the original length of the shape or mesh on the x axis and lets the script know how much it needs to scale the mesh or shape in order for it to fit between two points.

Future improvements

  • Different sphere types (currently just does fibonacci)
  • Other Geometric shapes (e.g. dodecahedrons)
  • Improved line algorithm to give more consistent triangles
  • Optimisation (e.g. client side rendering)
  • Death Stars
  • World Domination… :wink:
1 Like