โ† All examples

mesh algorithms

UV sphere with texture seam and pole fans

Build a latitude and longitude sphere with unit normals, a texture seam and one pole vertex per segment. Use it for globes, planets and any sphere that takes an equirectangular texture.

Recorded render of UV sphere with texture seam and pole fans

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • example.gltf
  • meshkit.py
  • preview.png
  • test_package.py
  • uv_sphere.py
  • verification/native.json

How it works

Entry points
uv_sphere, main
Parameters
radius, segments, rings
Complexity
O(segments * rings)
Axes
+Y up, metres

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • generator_runs_system_python
  • generator_runs_verifier_python
  • gltf_strict_structure
  • interpreters_agree
  • example_matches_generator
  • godot_headless_gltf_load
  • godot_compatibility_render

Limits to consider

The seam and the pole vertices are duplicated for texture coordinates, so the mesh is closed only after welding coincident vertices. Pole triangles are thin and the faces are not equal in area; use an icosphere or a cube sphere for even tessellation. The polygon volume and area are below the true sphere's and approach them as segments and rings grow.