#5 new
lindsay.kay (at xeolabs)

Support spatial lookup of assets

Reported by lindsay.kay (at xeolabs) | August 12th, 2010 @ 08:40 AM

Allow a kd-tree to be shared between browser and Asset Server

The SceneJS Asset Server can provide assets (models) to client scene graphs through WebSockets. Each asset has a unique ID and a 3D boundary. The server holds a kd-tree in memory, each node of which has a list of the IDs of assets that lie within it.

A client scene graph has a Socket node which connects to the server. When first rendered, the Socket opens its connection and sends the server a "getAssetMapBoundingBoxes", which is a request for the server's kd-tree (or a given portion of it). The server responds with a subgraph of BoundingBox nodes for the Socket to attach as a child node, each of which corresponds to a node in the kd-tree.

More detail in Wiki: Asset Server kD-tree

Comments and changes to this ticket

  • lindsay.kay (at xeolabs)

    lindsay.kay (at xeolabs) August 16th, 2010 @ 05:07 AM

    Assets should not be provided in its actual responses to Sockets - potentially it might be supplying the whole massive scene if the viewpoint was far enough back and localities were wide enough. Instead, it should provide references to assets, for the client to pull asynchronously.

    Bad Idea

    {
        /* Target node SID path:
         */
        "#root/alpha": {
     
            /* Maps to node's addNode method:
             */
            "+node" :
                    SceneJS.node({ sid: "asset789" }, // Note the asset ID
                            SceneJS.rotate({ angle: 45, y: 1.0 },
                                    SceneJS.translate({ x: 100 },
                                            SceneJS.objects.teapot())))
        }
    }
    

    Better Idea

    SceneJS.kdAsset is an extension node for asset server kd-tree client scenes, which will be defined alongside the client Socket subtree within a SceneJS content module. It will asynchronously pull the asset from the server using JSONP.

    {
        /* Target node SID path:
         */
        "#root/alpha": {
     
            /* Maps to node's addNode method:
             */
            "+node" : SceneJS.kdAsset({ uri: "http://assets.scenejs.org?cmd=getAsset&id=org.scenejs.models.myTeapot" })
        }
    }
    

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 ยป

A content server for SceneJS scene graphs.

Creates SceneJS assets from various source formats such as COLLADA and OBJ.

Supporting query on their metadata, and their download as either SceneJS JavaScript modules via HTTP, or as live content to pulled through a WebSocket.

Shared Ticket Bins

People watching this ticket

Pages