This is G o o g l e's cache of http://www.flashsandy.org/forum/lofiversion/index.php/t327.html as retrieved on 2 Aug 2007 01:17:58 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:4R0bYkHEThAJ:www.flashsandy.org/forum/lofiversion/index.php/t327.html+site:www.flashsandy.org+showtopic&hl=en&ct=clnk&cd=93


Google is neither affiliated with the authors of this page nor responsible for its content.
These search terms have been highlighted: showtopic 

Full Version: Custom scene location
Jeffrey Blyseth
Hello Gentlemen,
I have begun testing Sandy 1.2, looking good so far. I have a very basic question. In World3D, I don't see a method to set the scene location within a custom movie clip. If I change the line setContainer( _root ); in World3D() to setContainer( _root.my_custom_clip ); nothing shows up anymore.

Have any idea why?

Thanks smile.gif
kiroukou
Hi Jeffrey,

Well it sounds like a bug to me...
Have you an animated or static scene?

Just to be sure this is not a cache problem, can you do sometthing like that to test ?
World3D.getInstance().getCamera().moveForward(0);

And tell me if if your work show up again or not.

++
Jeffrey Blyseth
Hi Thomas,
I found that if I take the setContainer() command out of the World3D constructor and then call World3D.getInstance().setContainer(_root.my_custom_clip); then it works. However, ClipScreen appears to be broken or I don't understand how it's changed:

1. ClipScreen.as line 102 makes a call to _c.updateScreen(); where _c is the camera, but Camera3D does not have that method, which Flash is happy to complain about smile.gif
By adding
public function updateScreen(Void):Void
{

}
to Camera3D I quell this error but I get no clipping and no background color. To ensure that this was not related to me setting a custom clip as the _container I tried it with setContainer(_root); and got the same result. Any ideas?

Edit - Adding a key listener with World3D.getInstance().getCamera().moveForward(20); does move the camera as expected.
kiroukou
Don't forget to remove ASO files wink.gif
Jeffrey Blyseth
Hi Thomas,
I have removed the ASO files. No change. Are you saying that if the camera move WORKS then I have a cache problem?
kiroukou
Quite strange this clipscreen problem because clipscreen shall not exist anymore...

The fact to move the camera shall disable the cache system and solve sometimes the nothing drawn problem wink.gif
Jeffrey Blyseth
Oh, you mean that I shouldn't use clipscreen? Is it going away completely? Does this mean that the screen is always the size of the base flash movie and can no longer be clipped?
Jeffrey Blyseth
Hi Thomas,
Sorry to waste time, I found a clue to my answer in this post: http://www.flashsandy.org/forum/index.php?showtopic=320

I will come back shortly with more details.
Jeffrey Blyseth
As hardbutnot said, the scene is clipped in a square using the first value in Camera3D( p_nWidth:Number, p_nHeight:Number) for both width and height.

I wonder if this should be reconsidered. I would guess that in many cases a scene might have a 3:4 ratio or even a 16:9 ratio within a larger stage. While the scene can be masked, imagine if I have a 3D scene that's 800px wide by 200 high, I'm still going to be rendering the additional unseen 600px vertically, even if masked.

Am I understanding this correctly?

Further, for others who read this, please be sure to check out the default values for Camera3D.setPerspectiveProjection(fovY:Number, aspectRatio:Number, zNear:Number, zFar:Number), especially zNear and zFar. If you enableClipping on an object that is beyond these values on the z axis it will not appear.
kiroukou
Well no, in fact if you enable clipping on all your objects (strange behaviour I know, but for AS2 performance reason it is better I think) you'll not have anything drawn outside your 800x200 viewport. The clipping is computing the perfect intersection of your scene and your viewing volume. This way we don't display anymore what should not!

but this require also more process. I'm working with AS3 now, and as it is faster, I think I will enable clipping by default, in AS2 I'll have to do more tests wink.gif

Otherwise, yes the new camera parameters, and perspective one are really important! They describe how your scene will be seen and displayed smile.gif
Jeffrey Blyseth
QUOTE(kiroukou @ Feb 19 2007, 02:17 PM) *

Well no, in fact if you enable clipping on all your objects (strange behaviour I know, but for AS2 performance reason it is better I think) you'll not have anything drawn outside your 800x200 viewport.

This is not the experience I'm having. The viewport appears to be created based on the values passed with Camera3D creation, yet as hardbutnot said, it seems like the viewport is a square created by the first value only. Am I confusing the viewport with ClipScreen? If so, it seems like ClipScreen is not working at all. Can you provide some clarification on this?
QUOTE

but this require also more process. I'm working with AS3 now, and as it is faster, I think I will enable clipping by default, in AS2 I'll have to do more tests wink.gif

Do you mean that in AS2, it is faster to not have clipping enabled?
QUOTE

Otherwise, yes the new camera parameters, and perspective one are really important! They describe how your scene will be seen and displayed smile.gif

I can see how the new parameters both make things more flexible and, as the beta release post mentioned, improve the 'real world' equivalent. I guess overall I would like to understand where the clipping is happening, most particularly the width and height of the screen, as znear and zfar are obvious.

Thanks smile.gif
kiroukou
Yes the current release makes clipping a bit slower. But this will change with the official release, don't worry wink.gif

The dimensions you give to the camera (width and height) are the viewport dimension. So each object on your scene has clipping enable, noting shall be drawn outside this area.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2007 Invision Power Services, Inc.