#54 ✓resolved
lindsay.kay (at xeolabs)

Remove radius from SceneJS.Sphere

Reported by lindsay.kay (at xeolabs) | May 6th, 2010 @ 10:50 AM | in V0.7.4

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.

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.

Shared Ticket Bins

People watching this ticket

Pages