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=119 as retrieved on 31 Jul 2007 23:00:15 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:5RLPPezdsPsJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D119+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=67


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 _ Rotating a Plane3D

Posted by: Petit Aug 26 2006, 12:42 PM

Hi!
I have fiddled around quite a bit with the earlier version of Sandy, and got the transforms to work.
Now with the new and cleaner 1.1 version, I don't seem to get it.
I'm trying to rotate a single Plane3D, but it always shows the same horizontal plane.

I'm extending the Sandy class, using _root as the root MovieClip ( bg ).
Here is the createScene ( overloaded ) function:

CODE
function createScene( bg:Group){
    var planeGroup: Group = new Group();
    var plane1 = new Plane3D( 150, 150, 2, 'tri' );
    planeGroup.addChild(plane1);

    //Transformations
    var t:Transform3D = new Transform3D();
    t.rot( 0,0,-90 );
    var tg:TransformGroup = new TransformGroup(t);
    planeGroup.addChild(tg);
    bg.addChild(planeGroup);

    // The camera is working just fine;)
    getCamera().setPosition(0,200,-600);
    getCamera().lookAt(0,0,0);
    World3D.getInstance().render();
}


I'm looking at the horizontal Plane3D from above the ground y=200, and towards the origin [0,0,0].
With t.rot(0,0,-90) I expect to rotate the planeGroup by 90 degrees around the z-axis, and so get a vertical plane. But nothing happens, for any combinations of rotation values. The plane stays horizontal.

I'm sure I'm doing something wrong here, but what?

Posted by: kiroukou Aug 26 2006, 01:11 PM

CODE

function createScene( bg:Group){
    var planeGroup: Group = new Group();
    var plane1 = new Plane3D( 150, 150, 2, 'tri' );
  
    //Transformations
    var t:Transform3D = new Transform3D();
    t.rot( 0,0,-90 );
    var tg:TransformGroup = new TransformGroup(t);
    planeGroup.addChild(tg);
//add the objet you want to transform as a child of the transformation you want to apply!
tg.addChild(plane1);

    bg.addChild(planeGroup);



    // The camera is working just fine;)
    getCamera().setPosition(0,200,-600);
    getCamera().lookAt(0,0,0);
    // Don't use it here, the Sandy class calls it already World3D.getInstance().render();
}


wink.gif

Posted by: Petit Aug 26 2006, 10:59 PM

Thanks indeed for your swift reply.

I really should have known to read your excellent tutorials.
I just dumbly assumed that the tutorial was for the earlier version of Sandy (why?) unsure.gif

It's all working nicely for me now.

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