Away3D 3.6: Sprite3D and Clipping problems

Software: Away3D 3.x

ZenithSal, Newbie
Posted: 15 December 2011 10:29 PM   Total Posts: 2

Hello everyone smile
I’m having a problem with Sprite3D clipping in Away3D 3.6 (tested both the official stable and the repository latest).

I’m using Sprite3D to create a simple particle effect. The sprites showup when using RectangularClipping (since it doesn’t really do anything), but won’t show up at all when using NearfieldClipping or FrustumClipping.
However, I got a few other sprites that are working perfectly! it’s just this particle effect.. long face

I don’t mind using a quick hack to completely disable sprite clipping, I’m not using many anyway.

Here’s the problematic sprite class:

public class CFireSprite3D extends DirectionalSprite
 {
  
protected var isAlive:Boolean true;
  protected var 
mOrigin:Vector3D;
  protected var 
mDir:Vector2D;
  protected var 
nRange:Number;
  protected var 
nLifetime:Number 1.0;
  
  public function 
CFireSprite3D(material:Material_width:Number_height:Numberorigin:Vector3Dxz_direction:Vector2Drange:Number
  
{
   super
(material_width_height);
   
   
mOrigin origin;
   
mDir xz_direction;
   
nRange range;
   
   
init();
  
}  
  
  
protected function init():void
  {
   x 
mOrigin.x;
   
mOrigin.y;
   
mOrigin.z;
   
   
scaling 0.2;
   
BitmapMaterial(material).alpha 0.2;
  
}
  
  
public function start():void
  {
   
var ex:Number mOrigin.+ (mDir.nRange);
   var 
ez:Number mOrigin.+ (mDir.nRange);
   
Tweener.addTween(this{ x:exz:eztime:nLifetimeonComplete:endtransition:"linear" );
   
Tweener.addTween(this{ scaling:1.5time:nLifetime 1.5transition:"linear" );
   
Tweener.addTween(BitmapMaterial(material), { alpha:0.6time:nLifetime 3transition:"linear" );
   
Tweener.addTween(BitmapMaterial(material), { alpha:0delay:nLifetime 0.73time:nLifetime 0.25transition:"linear" );
  
}
  
  
public function end():void
  {
   isAlive 
false;
   
parent.removeSprite(this);
  
}
  
  
//////////////////////////////////////////////////// Accessors
  
public function get alive():Boolean
  {
   
return isAlive;
  
}
 } 

Any help is appreciated smile

   

ZenithSal, Newbie
Posted: 21 December 2011 08:49 PM   Total Posts: 2   [ # 1 ]

No one? okay downer
I managed to hack it with the least intrusive way possible. The problem was that the bounding box of the sprite3d container (ObjectContainer3D) always checks as being in INTERSECT with the view even if it’s nowhere near frustum, and that makes all Sprite3Ds inside the object somehow not render (they should! since INTERSECT means that the object is partially visible).
So, I ended up searching for 2 hours for who fills “nodeClassificationDictionary” inside CameraVarsStore which seems to hold values 0/1/2 for every object representing object view classification as IN/OUT/INTERSECT, but I could not! who the hell fills that dictionary? the only object that has any visibility calculations in regards to IN/OUT/INTERSECT is Frustum.as and setting a breakpoint there never triggers.

Second try was looking for a way to disable Sprite3D not-rendering when the container is in INTERSECT, I couldn’t figure that out.

In the end, I just added a new property to Object3D to selectively disable clipping, and added a simple check for it in PrimitiveProjector.project()
Now I can just set ObjectContainer3D to noclip and.. VoilĂ ! the fire sprites render.

I attached the modified files here if someone runs into the same issue and asks in the forum and not get a single reply after 6 days..

 

File Attachments
Object3D_noclip.zip  (File Size: 14KB - Downloads: 180)
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X