Hi again. I did it now with scrollRect, getting the same result (I guess
performance would be better). But applying the scrollRect to view3D is hard,
because when I change view position or size I need to do the same with
scroll rectangle, and if I hide the "mask" with: view.scrollRect = null; the
view is changing position.
So I ended applying scrollRect to parent container (BasicTemplate in my
case):
scrollRectangle = new Rectangle(0, 0, w, h);
override public function set width(value:Number):void
{
w = value;
graphics.clear();
DrawUtils.DrawRectangle(graphics, value, h, 0x444444);
view.x = w*.5;
view.y = h*.5;
scrollRectangle.width = w;
scrollRect = scrollRectangle;
clipping.minX = -w*.5;
clipping.maxX = w*.5;
}
override public function set height(value:Number):void
{
return;
}
public function set clippingMask(value:Boolean):void
{
if(value) scrollRect = scrollRectangle;
else scrollRect = null;
}
And here is the result:
With view.mask = anyRectangleSprite
http://dev.xleon.net/testing/ClippingMask.swf
With scrollRect:
http://dev.xleon.net/testing/ClippingAndScrollRect.swf
El 14 de marzo de 2010 15:25, Diego Ponce de León <[email protected]>escribió:
> I forgot: There is a little checkbox to show/hide mask
>
> El 14 de marzo de 2010 15:24, Diego Ponce de León
> <[email protected]>escribió:
>
> Hi katopz, thanks for helping.
>> You can see my test here: http://dev.xleon.net/testing/ClippingMask.swf
>>
>> I´m going to try now with scrollRect and the way you said.
>>
>> 2010/3/14 katopz <[email protected]>
>>
>> Hey Diego
>>>
>>> I think you mean frustumclipping that's not exist in lite yet sry
>>> you try can combine frustumculling and scrollRect and view.setSize for
>>> same result
>>> plus some speed cause scrollRect is native clip
>>> here's some example for clipping (before apply scrollRect)
>>> http://away3d.googlecode.com/svn/branches/lite/bin/ExClipping.swf
>>>
>>> src+libs
>>> http://away3d.googlecode.com/svn/branches/lite/
>>>
>>> hth
>>>
>>> 2010/3/14 Diego Ponce de León <[email protected]>
>>>
>>> Hi, I did it just adjusting the RectangleClipping to width and height I
>>>> need, and then I masked the view3D with a rectangle sprite to hide the
>>>> faces
>>>> going outside of clipping rectangle.
>>>> I needed a perfect rectangle area, because my view3D is smaller than
>>>> stage.
>>>> Is this a good work arround?
>>>>
>>>> El 13 de marzo de 2010 19:38, Diego Ponce de León
>>>> <[email protected]>escribió:
>>>>
>>>> Hi all, Im trying to guess how to limit the view3D with and height.
>>>>> It maybe something basic, but I can´t get it to work.
>>>>> I was trying with view.scrollRect, but I don´t like the results and I
>>>>> guess there is a better way to do this.
>>>>>
>>>>> I need my 3d view to exact fit a fixed height and fit the width to
>>>>> stage.stageWidth
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> --
>>>>> Diego Ponce de León
>>>>>
>>>>> http://www.xleon.net
>>>>> http://www.xinterface.net
>>>>> http://twitter.com/diegoxleon
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Diego Ponce de León
>>>>
>>>> http://www.xleon.net
>>>> http://www.xinterface.net
>>>> http://twitter.com/diegoxleon
>>>>
>>>
>>>
>>>
>>> --
>>> katopz
>>> http://www.sleepydesign.com
>>>
>>>
>>
>>
>> --
>> Diego Ponce de León
>>
>> http://www.xleon.net
>> http://www.xinterface.net
>> http://twitter.com/diegoxleon
>>
>
>
>
> --
> Diego Ponce de León
>
> http://www.xleon.net
> http://www.xinterface.net
> http://twitter.com/diegoxleon
>
--
Diego Ponce de León
http://www.xleon.net
http://www.xinterface.net
http://twitter.com/diegoxleon