need help optimising large number of objects…

Software: Away3D 4.x

Karim Beyrouti, Administrator
Posted: 13 March 2012 06:35 PM   Total Posts: 30

Following example has about 7000 points dotted around the globe, it takes a noticeable performance hit after a couple thousand:

http://kurst.co.uk/samples/point_cloud_test

Example re-uses one Geometry, and ColorMaterial between all the points (CODE Below). Each ‘MarkerBase’ is in turn added to a ObjectContainer3D (app needs MouseOver/Out/Click handlers for the markers). Any help or pointers for optimizing whistle keeping functionality would be great.

Many thanks - Karim

package com.kurst.geoglobeapp.components.geoglobe.markers {

 import away3d
.containers.ObjectContainer3D;
 
import away3d.entities.Mesh;

 public class 
MarkerBase extends ObjectContainer3D {

  
private static var mat ColorMaterial;
  private static var 
geom SphereGeometry;
  
  public var 
mesh   Mesh;
  public var 
mouseTarget  Mesh;
    
  public function 
MarkerBase( ) {
  
   super
();

   if ( ! 
SimpleSphereMarker.mat )
    
SimpleSphereMarker.mat = new ColorMaterial0xFFFF00 );
   
   if ( ! 
SimpleSphereMarker.geom 
    
SimpleSphereMarker.geom = new SphereGeometry.25 )

   
mouseTarget mesh = new MeshSimpleSphereMarker.geom SimpleSphereMarker.mat );
   
addChildmarkerSphere );
   
  
}
 }

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X