Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Remove radius from SceneJS.Sphere

#54

The radius property is not actually being used by the sphere node.

Its to subtly encourage optimal use. When you define a sphere of say, 20 bands and 30 slices, then the first time the sphere node is rendered it checks to see if a set of geometry buffers (ie. positions, uv, texture coords and indices) is currently loaded into VRAM, mapped by SceneJs to ID "sphere_20_30".

On the first time the sphere node is rendered, there are probably no such geometry buffers, so it creates, loads and binds them, then draws them.

Then when that sphere node is rendered again (or any other sphere node specifying 20 bands and 30 slices) then that buffer set will be found in VRAM and rendered again.

The sphere is always a unit sphere, to be sized if required using SceneJS.size nodes. That way the user is encouraged to re-use the same buffered geometry across various sized spheres. If you could vary the radius, then you might accidentally create hundreds of sphere geometry buffers.

Reported by lindsay.kay (at xeolabs) · May 6th, 2010 @ 10:50 AM

State: resolved
Milestone: V0.7.4

Activity

  1. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)
    • State changed from open to resolved

    May 7th, 2010 @ 10:12 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.