/ Published in: ActionScript 3
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!
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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; } } }