Skip to content

Scene: Spherical and Cylindrical, with Vector3.setFromSpherical and setFromCylindrical, as three.js has them - #229

Closed
kvnloo wants to merge 1 commit into
meshy-dev:mainfrom
kvnloo:swarm/a11-parity-spherical
Closed

kvnloo wants to merge 1 commit into
meshy-dev:mainfrom
kvnloo:swarm/a11-parity-spherical

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Adds three.js r187's Spherical and Cylindrical classes and their Vector3 conversions: setFromSpherical, setFromSphericalCoords, setFromCylindrical and setFromCylindricalCoords. Orbit cameras and radial placement code that use these can now run unchanged. They follow three's conventions: phi is the polar angle from +Y, theta the azimuth around Y from +Z, makeSafe clamps phi to [1e-6, π − 1e-6], and the origin converts to zero angles.

Test: packages/scene/test/three-compat-spherical.test.ts covers the defaults, known points (+X, the origin, theta 0 → +Z), Vector3 → spherical/cylindrical → Vector3 round trips, makeSafe at both poles, and clone/copy.

npm run typecheck and npm test pass.

Drafted with AI assistance.

🤖 Generated with Claude Code

…etFromCylindrical, as three.js has them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kvnloo

kvnloo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #249 so these review together; closing this one.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant