This is G o o g l e's cache of http://www.flashsandy.org/forum/lofiversion/index.php/t274.html as retrieved on 1 Aug 2007 19:25:10 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:Zt7mwzpEr4UJ:www.flashsandy.org/forum/lofiversion/index.php/t274.html+site:www.flashsandy.org/forum&hl=en&ct=clnk&cd=25


Google is neither affiliated with the authors of this page nor responsible for its content.

Ron Wheeler
I am trying to work through the tutorial using mtasc with Flashout under Eclipse.
I am on the second step - putting a box on the screen.

I have removed some white space and comments to shorten the post
CODE

class com.rwcontrols.sandytest.TestMain {
    static var app : TestMain;
        function TestMain() {
            var myMC : MovieClip
                try
                   {  _root.createEmptyMovieClip('myMC', 1)
                    init(_root.myMC); }
                catch (e:Error)
                    {trace(e.message);}
                   }

    // entry point
    static function main(mc) {app = new TestMain();    }

function init( stage : MovieClip  ):Void
{
   var ecran:ClipScreen = new ClipScreen( stage, 600, 600 );
   var cam:Camera3D = new Camera3D( 400, ecran);
   World3D.getInstance().addCamera( cam );
   var bg:Group = new Group();
   World3D.getInstance().setRootGroup( bg );
   createScene( bg );
}
static function createScene( bg:Group ):Void
{
    var o:Object3D = new Box( 50, 50, 50 );

    bg.addChild( o);
}

}
It compiiles quite nicely with no errors but does not draw a box on the screen

C:\mtasc\mtasc.exe  -swf C:\eclipse\workspace\sandytest\test.swf -cp C:\eclipse\workspace\sandytest\src -main com\rwcontrols\sandytest\testmain.as -trace Flashout.traceReplacer -header 800:600:20  -cp C:\mtasc\std8
..... compilation complete!


If I test
    try
    {  _root.createEmptyMovieClip('myMC', _root.getNextHighestDepth());
        _root.myMC.createTextField("tf",0,0,0,800,600);
        _root.myMC.tf.text = "Hello world !";
//       init(_root.myMC);
}
    catch (e:Error)
    {trace(e.message);}
    }
I do see "Hello World"

If I test
    try
    {  _root.createEmptyMovieClip('myMC', _root.getNextHighestDepth());
        _root.myMC.createTextField("tf",0,0,0,800,600);
        _root.myMC.tf.text = "Hello world !";
       init(_root.myMC);
}
    catch (e:Error)
    {trace(e.message);}
    }
"Hello World" does not appear.

In the end I hope to use Sandy with ActionStep to create a business application that combines simple 3D graphics with a forms based application.
I hope to be able to Ant rather that Flashout to develope the system once I get the graphics working reliably.

Ron
Anybody gone down that road.
kiroukou
Hi Ron smile.gif

Well you need to launch the scene you' ve created wink.gif

World3D.getInstance().render() at the end of the init function.

You project sounds to be really cool ! Do not hesitate to keep us informed smile.gif
Ron Wheeler
QUOTE(kiroukou @ Jan 21 2007, 06:09 PM) *

Hi Ron smile.gif

Well you need to launch the scene you' ve created wink.gif

World3D.getInstance().render() at the end of the init function.

You project sounds to be really cool ! Do not hesitate to keep us informed smile.gif


I was too aggressive in removing the comments. I actually have it but it still does not work

function init(stage: MovieClip):Void
{
// screen creation, the object where objects will be displayed.
var ecran:ClipScreen = new ClipScreen(stage, 600, 600, 0xFF0000 );
trace(Flashout.DEBUG+ecran)
// we create our camera
var cam:Camera3D = new Camera3D( 700, ecran);
// we add the camera to the world
World3D.getInstance().addCamera( cam );
// we create the root node.
var bg:Group = new Group();
// and set it as the root node of the world.
World3D.getInstance().setRootGroup( bg );
// and we lauch the scene creation
createScene( bg );
// and now everything is created, we can launch the world rendering.
World3D.getInstance().render();
}

Is there someplace to put a trace to see if the "world" is set up with the box?
Is there someplace to put a trace in the render to see if it is being executed properly?


Petit
QUOTE(Ron Wheeler @ Jan 22 2007, 03:29 AM) *

I was too aggressive in removing the comments. I actually have it but it still does not work
Is there someplace to put a trace to see if the "world" is set up with the box?
Is there someplace to put a trace in the render to see if it is being executed properly?


Your code seems to work. I used it in the Flash 8 IDE, only changing to non class.
What you missed her, is that the camera is in the middle of the cube, at the origin [0, 0, 0].
You have to back up a bit along the negative z axis, like this: ( in the init() method )

CODE
   cam.setPosition(0,0,-300);
Ron Wheeler
Thanks.
This line is missing from the first tutorial example and I did not see it get added in the second.
In spite of it being highlighted in colour and clearly explained in the text above the box.

I was trying to get the experience of actually typing the code. I guess that I would have saved a lot of grief by cheating and copying and pasteing (or reading the instructions more carefully).
I guess the only thing more that author could have was to come over and watch me while I typed it.


It did give me a chance to read a lot of the code and practice my debugging skills (need improvement, I guess - next in line for work after my reading abilities).

Ron
kiroukou
Learning 3D requires some attention and some time.

You are starting correctly, just keep continue wink.gif
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.