This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=181 as retrieved on 1 Aug 2007 13:00:17 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:7ZcWb-kHrLgJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D181+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=81


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ Movies on different faces

Posted by: plastichorse25 Nov 14 2006, 08:59 PM

Can anybody give me a hint how i can place different movieskins on different faces?

Posted by: Petit Nov 14 2006, 11:38 PM

Well, it depends on the kind of object you are using.
If you are trying to place MovieSkin's on a cube, you can get an Array of the Face's,using

CODE

var faces:Array = cube.getFaces();
faces[0].setSkin(skin);
faces[1].setSkin(skin);
faces[2].setSkin(skin);
faces[3].setSkin(skin);
faces[4].setSkin(skin2);
faces[5].setSkin(skin2);


If the quality is the default and the mode is 'quad' , which is not recommended, each side has only one face.
If the mode is 'tri' to get better perspective distortion, each side has two faces, and you set the same skin to both, as in the example above. For more on the matter, see http://www.petitpub.com/labs/media/flash/sandy/skinning.shtml.

Posted by: plastichorse25 Nov 15 2006, 01:03 PM

Thanks for reply.

But there are still some other problems. As you can see in the attached swf, the images are only shown if you navigate (means: push the mouse button ot use the ARROW KEYS). For what reason?

The other problem is the distortion of the pictures if you turn around. Is there any possibility to get rid of that?

Thank you,

plastichorse


Attached File(s)
Attached File  061114_test1.swf ( 241.98k ) Number of downloads: 19

Posted by: kiroukou Nov 15 2006, 01:15 PM

Hi,
Are you using Sandy 1.1?

Otherwise without any code information (what happen when you push the keyboard key, etc.) I can't say more about your problem (can't watch the swf from here)
++

Posted by: plastichorse25 Nov 15 2006, 01:19 PM

Yes I do.

Here is the as-file, too. Thanks for the fast reply.


Attached File(s)
Attached File  Test.as ( 3.34k ) Number of downloads: 10

Posted by: kiroukou Nov 15 2006, 04:48 PM

I looked at your code, and the problems doesn't seems to be here...

Just a remark :
my3DObject.swapCulling();
my3DObject.enableBackFaceCulling = false;

If you disable the backfaceculling, you don't it to swap it wink.gif

I'll say more once I can see the swf at home.

++

Posted by: plastichorse25 Nov 15 2006, 05:43 PM

thanks for that. but without swapCulling and enableBackFaceCulling, i don't see anything.

Posted by: Petit Nov 15 2006, 11:06 PM

This might be completely wrong - take it as guesswork.
It looks immersive, so I guess you're inside the cube.
Yuo swap the backface culling so only the inside faces should be drawn.

Then to avoid the extra drawings of the outside of the faces, you should have back face culling enabled.
Then you don't see anything, because you have no images on the inside of the cube,
You have no setBackFace( skin ) calls for your faces.

So you disable back face culling, and somehow the outside skins are shining through, when you pan.

If I an right you should just set the back face skins.

If I'm right, I'm only lucky wink.gif

Good luck!

Posted by: Petit Nov 15 2006, 11:24 PM

NOP.

I tested this and used only back skins.
The only difference is that I didn't have to use swapCulling.
The result is the same. The MovieSkin's only render when the image cube is moving,
either by mouse press or Key.RIGHT and Key.LEFT.

It looks as if the rendering stops, when the cube isn't moving.
Strange!

Posted by: Petit Nov 15 2006, 11:50 PM

Well, stubborn as I am, I'm back.
When you create your skins, you set the automatic update to false, which means the Worls3D onRenderEvent does not automatically update the textures.
When you interact by using your mouse or keyboard, the camera is moved, and schedules the skins for an update ( new perspective ).

Your worlds onRenderEvent has a handler called interactions.
The handler check for the mouse and key board, and if any interaction is going on, moves the camera,
and the textures will be updated.

If there is no current interactions, the camera doesn't move, and the textures are not rendered.

My quick and dirty solution was to always move the camera at the top of the interactions method, like this:

CODE
function interactions():Void{
        var myCam:Camera3D = _myWorld.getCamera();

        myCam.rotateY(0); // <-- This will schedule the skin textures for an update

        if(_myMouseToggle) {
            if(_xmouse > (200)) {
                 // etcetera

That works, but a more elegant solution would be good.

Posted by: kiroukou Nov 16 2006, 07:08 AM

This is a cache problem.
Sandy has a cache that allows you to avoid extra computations when nothing is moving.

Don't remember with the 1.1, but the demo I've rewritten with 1.2 works fine.

As I'm preparing a new release, I just recommend for instance to fix this problem as Petit said (even if it looks horrible to me smile.gif )


Posted by: plastichorse25 Nov 16 2006, 11:23 AM

Yapp,

changed it to backfaces now. And solved the problem by using the cam rotation.

@kiroukou: I know this is an annoying question: But when is the new version of sandy going to be released? And will it be ported to AS3 already?

Posted by: kiroukou Nov 16 2006, 12:36 PM

The next release will be ready quite soon. Few problems still exists, and I want to fix them first. But you can expect it to be available in a month in the worst case.

I'll talk about AS3 a bit later...

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)