[Papervision3D] grabbing the width property of a DO3d.container
Gil Birman
gil at allflashwebsite.com
Tue Jan 27 22:30:00 PST 2009
Maybe use DO3D.autoCalcScreenCoords
<http://docs.pv3d.org/org/papervision3d/objects/DisplayObject3D.html#autoCalcScreenCoords>to
calculate position of plane relative to 2D screen.
On Tue, Jan 27, 2009 at 4:03 PM, Ross Sclafani <ross.sclafani at gmail.com>wrote:
> i wrote this plane subclass that gives me the plane's width and height:
> i imagine the getters could be written to be recursive down the children
> tree... not there yet though.
> if you made SmartObject3D extends DisplayObject3D, and built in the
> recursive measuring methods, i think you'd have what you need.
> just mail me a copy please!
> _ross
>
> package net.kolektiv.pv3d.objects.smart
> {
> import org.papervision3d.objects.primitives.Plane;
> import org.papervision3d.core.proto.MaterialObject3D;
>
> public class SmartPlane extends Plane
> {
> public function SmartPlane( material:MaterialObject3D=null,
> width:Number=0, height:Number=0, segmentsW:Number=0, segmentsH:Number=0 ){
> super(material,width,height,segmentsW,segmentsH);
> }
>
> public function get width(){
> return (geometry.aabb.maxX -
> geometry.aabb.minX)*scaleX;
> }
> public function get height(){
> return (geometry.aabb.maxY -
> geometry.aabb.minY)*scaleY;
>
> }
> }
> }
>
>
> On Jan 27, 2009, at 4:44 PM, jared stanley wrote:
>
> i have a displayObject3D called planeHolder, i add a bunch of planes
>> inside it in a grid layout... - i would like to get the total width of
>> the planeHolder so i know how wide/tall the grid is...
>>
>>
>> trace(planeHolder.container.height); //this throws a 'null' error
>>
>> is this possible? if not, why not?
>>
>> thanks for your help!
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090128/affb76cb/attachment-0001.html>
More information about the Papervision3D
mailing list