Return to Snippet

Revision: 22160
at January 4, 2010 13:14 by babyC


Initial Code
package com.nocreativity.pv3d.utils
{
	import org.papervision3d.objects.DisplayObject3D;
	
	public class ThreeDeeUtils
	{
		public static function getWidth(displayObject3D:DisplayObject3D):Number{
			return (displayObject3D.geometry.aabb.maxX -  displayObject3D.geometry.aabb.minX)*displayObject3D.scaleX;
		}
		public static function getHeight(displayObject3D:DisplayObject3D):Number{
			return (displayObject3D.geometry.aabb.maxY -  displayObject3D.geometry.aabb.minY)*displayObject3D.scaleY;
		}

	}
}

Initial URL

                                

Initial Description
Apparently you just can't get the height/width of a displayObject3D in Papervision3D. So here's  a simple class that does exactly that for you!

Initial Title
PV3D Utils for calculating heights and width of DisplayObjects3D

Initial Tags

                                

Initial Language
ActionScript 3