Noob problem with clipping

4 views
Skip to first unread message

msmooshoo

unread,
Mar 18, 2009, 9:16:54 PM3/18/09
to away3d.dev
Hey everyone. I'm adding my away3d object to a child container on my
Flex stage, but the view clipping range seems to be set to the
parentApplication stage's width/height coordinates. Can someone please
tell me how to find my object's parent container's rectangle that I
can use for the clipping? I imagine it is something like:
view.clipping.rect(this.parent.x, this.parent.y, this.parent.width,
this.parent.height) - but this doesn't seem to work...

zs...@hotmail.com

unread,
Mar 18, 2009, 11:34:48 PM3/18/09
to away3d.dev
if you wanna to control parent path , it has two way:
first:use static variables
second:control parent and object in parent class.

msmooshoo

unread,
Mar 18, 2009, 11:56:39 PM3/18/09
to away3d.dev
Thanks zszen.

I can control the parent object, but what is happening, is that the
away3d object is bleeding over the edge of the parent object's
borders. I'm trying to keep the 3d object to from bleeding over the
edge of the parent container.

Rob Bateman

unread,
Mar 20, 2009, 6:52:27 PM3/20/09
to away3...@googlegroups.com
Hey msmooshoo

to override the automatic clipping that takes it's cue from the stage edges, you need to reset the min and max clipping values:


view.clipping.minX = -view.x;
view.clipping.minY = -view.y;
view.clipping.maxX = this.parent.x + this.parent.width;
view.clipping.maxY = this.parent.y + this.parent.height;


however, for this to work correctly you need to ensure that:

a) your parent sprite has a background that is the desired dimensions of the viewport
b) the view is positioned in the center of the parent sprite (ie. at this.parent.width/2, this.parent.height/2)

hth!

Rob


2009/3/19 msmooshoo <jphoeni...@gmail.com>



--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

msmooshoo

unread,
Mar 22, 2009, 1:05:20 PM3/22/09
to away3d.dev
That worked splendidly. Thanks Rob! :)

On Mar 20, 3:52 pm, Rob Bateman <rob.bate...@gmail.com> wrote:
> Hey msmooshoo
>
> to override the automatic clipping that takes it's cue from the stage edges,
> you need to reset the min and max clipping values:
>
> view.clipping.minX = -view.x;
> view.clipping.minY = -view.y;
> view.clipping.maxX = this.parent.x + this.parent.width;
> view.clipping.maxY = this.parent.y + this.parent.height;
>
> however, for this to work correctly you need to ensure that:
>
> a) your parent sprite has a background that is the desired dimensions of the
> viewport
> b) the view is positioned in the center of the parent sprite (ie. at
> this.parent.width/2, this.parent.height/2)
>
> hth!
>
> Rob
>
> 2009/3/19 msmooshoo <jphoenix.ris...@gmail.com>
>
>
>
>
>
> > Thanks zszen.
>
> > I can control the parent object, but what is happening, is that the
> > away3d object is bleeding over the edge of the parent object's
> > borders. I'm trying to keep the 3d object to from bleeding over the
> > edge of the parent container.
>
> > On Mar 18, 8:34 pm, "zs...@hotmail.com" <zs...@hotmail.com> wrote:
> > > if you wanna to control parent path , it has two way:
> > > first:use static variables
> > > second:control parent and object in parent class.
>
> > > On 3月19日, 上午9时16分, msmooshoo <jphoenix.ris...@gmail.com> wrote:
>
> > > > Hey everyone. I'm adding my away3d object to a child container on my
> > > > Flex stage, but the view clipping range seems to be set to the
> > > > parentApplication stage's width/height coordinates. Can someone please
> > > > tell me how to find my object's parent container's rectangle that I
> > > > can use for the clipping? I imagine it is something like:
> > > > view.clipping.rect(this.parent.x, this.parent.y, this.parent.width,
> > > > this.parent.height) - but this doesn't seem to work...
>
> --
> Rob Bateman
> Flash Development & Consultancy
>
> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com
Reply all
Reply to author
Forward
0 new messages