23.1.11

More Thinking about FLARBuilder

I've noticed that in the example I'm working with, when a marker is removed, its associated object is deleted from the scene. Specifically, some irrelevant stuff, the code is:


var container:DisplayObject3D = this.containersByMarker(marker);
if(container){
this.scene3D.removeChild(container);
}
delete this.containersByMarker[marker];


So, the container (a model) is removed from scene3D (what I currently believe is what contains a 3D scene to be rendered each frame), and then... a container is deleted?

I tried commenting these lines out to keep a 3D model in the scene while its marker disappears, but what actually happens when the marker comes back is another instance of the model is created, leaving the old one sitting where it was. It gave me an interesting idea that AR could be used for quick, relatively intuitive "additive" 3D modelling. This is because whenever a new model is added to the scene, it can intersect other models already in it. So, for example, you could define a set of useful primitives associated with given markers. You could then have a "button" marker that the user can cover to trigger a primitive's marker to drop its model in the location it's currently at.

Rotating a scene set up like that, however, would currently be a mystery to me unless I can figure out how to associate models with other markers, and lock their orientation relative to that marker (otherwise they'd be automatically aligned with it).

In any case, that's just an interesting aside. My next immediate task is to find out how to permanently associate markers with given models, so when you cover a marker, its model stays in that position until the marker is found again.

No comments:

Post a Comment