This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?showtopic=314&pid=1772&mode=threaded&show=&st=& as retrieved on 26 Jul 2007 11:22: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:PN9TZzbV0M4J:www.flashsandy.org/forum/index.php%3Fshowtopic%3D314%26pid%3D1772%26mode%3Dthreaded%26show%3D%26st%3D%26+site:www.flashsandy.org+showtopic&hl=en&ct=clnk&cd=61


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: showtopic

Welcome Guest ( Log In | Register )

> First bug in AS2 1.2 Beta2 release
damo
post Feb 13 2007, 08:58 AM
Post #1


Advanced Member
***

Group: Members
Posts: 43
Joined: 20-June 06
Member No.: 26



Hi all,
I'm currently testing the new release and i find some new bugs.
The Sphere object is not really a "sphere" and faces are not correctly render.
You can see an exemple here :

CODE
/*
classe Univers
Version 0.1
Auteur : Damo
Copyright Tamina
*/
import sandy.core.group.*;
import sandy.core.data.*;
import sandy.view.*;
import sandy.core.*;
import sandy.skin.*;
import sandy.primitive.*;
import sandy.core.transform.*;
import sandy.events.*;
import sandy.util.*;
import sandy.math.Matrix4Math;
import sandy.math.VectorMath;
import mx.utils.Delegate;
import flash.display.BitmapData;

class testBeta2 {
    // Propriétés d'instance
    private var __screen:MovieClip;
    private var __cam:Camera3D;
    private var __rootGrp:Group;
    private var circlePos:Number=-180;
    private var incrementeur:Number=5;
    private var __grille3D:Plane3D;
    //Test focal
    private var _fov:Number = 29;
    private var _ratio:Number = 2.4;


    public var monDispatcher:MovieClip;

    //Constructeur
    function testBeta2 () {
    }

    //Methodes
    public function init(largeur:Number, hauteur:Number):Void {
        //Initialisation de la camera
        __screen = _root.createEmptyMovieClip("scene3D",7);
        World3D.getInstance().setContainer(__screen);
        __cam = new Camera3D(largeur, hauteur);
        __cam.setPerspectiveProjection(_fov,_ratio,1.0,1000.0);
        __cam.setPosition(0, 30, -600);
        __cam.lookAt(0,0,0);
        World3D.getInstance().setCamera( __cam );
        //Initialisation du groupe root
        __rootGrp = new Group();
        World3D.getInstance().setRootGroup( __rootGrp );
        //Creation de la grille
        __rootGrp.addChild(createGrille());
        //Creation du fond
        __rootGrp.addChild(createFond());
        //Rendu
        World3D.getInstance().render();
        //Ecoute rotation
        var unEcouteur:Object = new Object();
        unEcouteur.onKeyDown = Delegate.create(this, worldRotate);
        unEcouteur.onKeyUp = Delegate.create(this, initWorldRotate);
        Key.addListener(unEcouteur);
    }
    //*********** PRIVATE ****************//
    private function initWorldRotate():Void {
        incrementeur = 5;
    }
    private function worldRotate():Void {
        var distance:Number = 600;
        var pi:Number = Math.PI;
        if(Key.isDown(Key.LEFT)) {
            var CamY:Number = World3D.getInstance().getCamera().getPosition().y;
            // On tourne vers la gauche
            circlePos -=incrementeur;
            incrementeur++;
            World3D.getInstance().getCamera().setPosition(Math.cos(circlePos*pi/360)*distance,CamY,Math.sin(circlePos*pi/360)*distance);
            World3D.getInstance().getCamera().lookAt(0,0,0);
        }
        if(Key.isDown(Key.RIGHT)) {
            var CamY:Number = World3D.getInstance().getCamera().getPosition().y;
            // On tourne vers la droite
            circlePos +=incrementeur;
            incrementeur++;
            World3D.getInstance().getCamera().setPosition(Math.cos(circlePos*pi/360)*distance,CamY,Math.sin(circlePos*pi/360)*distance);
            World3D.getInstance().getCamera().lookAt(0,0,0);
        }
    }
    private function createGrille():TransformGroup{
        var grilleSkin:MixedSkin = new MixedSkin(0x00FF00,20,0x00FF00,100,1);
        var grilleTGrp:TransformGroup = new TransformGroup ();
        __grille3D = new Plane3D(150,150,6,"quad");
        __grille3D.setSkin(grilleSkin);
        grilleTGrp.addChild(__grille3D);
        return grilleTGrp;
    }
    private function createFond():TransformGroup{
        var fondSkin:BitmapData = BitmapData.loadBitmap("3246.jpg");
        var maSkin:TextureSkin = new TextureSkin(fondSkin);
        var fondTGrp:TransformGroup = new TransformGroup ();
        var monFond:Sphere = new Sphere(50,1,"tri");
        //monFond.enableBackFaceCulling(false);
        monFond.setSkin(maSkin);
        fondTGrp.addChild(monFond);
        return fondTGrp;
    }
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
damo
post Feb 13 2007, 01:37 PM
Post #2


Advanced Member
***

Group: Members
Posts: 43
Joined: 20-June 06
Member No.: 26



QUOTE
"with 0 in camera height, it is the same???"

Exactly !

QUOTE
Otherwise, in fact, i meant to do this :
__cam.setPosition(0, 0, -600);


See the attachment for result (IMG:style_emoticons/default/mellow.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Petit
post Feb 13 2007, 02:41 PM
Post #3


Advanced Member
***

Group: Moderator
Posts: 560
Joined: 21-June 06
From: Borgholm, Sweden
Member No.: 38



QUOTE(damo @ Feb 13 2007, 02:37 PM) *

Exactly !
See the attachment for result (IMG:style_emoticons/default/mellow.gif)

You are right that there is a bug in the sort order, which means faces that should really be hidden behind others, are rendered. This is something that is worked on.

The fact that the sphere in your first example was not a sphere, has to do with two things:
1. The quality setting is '1' which gives you far too few faces to build a sphere.
A setting of '10' is more like it.
2. You had set the aspect ration of the camera projection to 2.4, which means that you get a cigar
rather than a sphere.

Then of course there are other problems as well. One is that your image doesn't seem to cover the whole sphere, leaving a white part. It is also not easy to tell how a square image should be projected on a sphere, to make it distort nicely.

Attached is my test of your application, the best I could get.
Here are my changes:
CODE
    //Test focal
    private var _fov:Number = 29;
    private var _ratio:Number = 1; // aspect ration is 1.0

Camera position. I used a smaller distance:
CODE
        __cam.setPosition(0, 30, -300);

And in the worldRotate method I changed the distance accordingly:
CODE
        var distance:Number = 300;

I set a higher quality for the Sphere:
CODE
        var monFond:Sphere = new Sphere(50,10,"tri");


Attached is the result:


Attached File(s)
Attached File  TestBeta2.swf ( 801.88k ) Number of downloads: 100
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
damo   First bug in AS2 1.2 Beta2 release   Feb 13 2007, 08:58 AM
kiroukou   Hi damo, Can you attach a screenshot for those who...   Feb 13 2007, 09:16 AM
damo   Tsssss <_< As you can look, this is not a...   Feb 13 2007, 09:39 AM
kiroukou   Try to comment this line : __cam.setPerspectiveP...   Feb 13 2007, 09:44 AM
damo   Yes that much better. No more lemon ;) But the sor...   Feb 13 2007, 09:57 AM
kiroukou   The sorting thing is known, and another approach. ...   Feb 13 2007, 10:13 AM
damo   Stage.width and Stage.height   Feb 13 2007, 10:15 AM
kiroukou   And if you set the camera height to 0 ? :)   Feb 13 2007, 10:23 AM
damo   Not better   Feb 13 2007, 10:30 AM
kiroukou   (a screenshot please?) :)   Feb 13 2007, 10:35 AM
damo   Not necessary, cause nothing change. using __cam =...   Feb 13 2007, 10:35 AM
kiroukou   with 0 in camera height, it is the same??? Otherw...   Feb 13 2007, 11:02 AM
damo   Exactly ! See the attachment for result :...   Feb 13 2007, 01:37 PM
Petit   Exactly ! See the attachment for result :mel...   Feb 13 2007, 02:41 PM
kiroukou   Indeed it seems to be something strage around here...   Feb 13 2007, 02:03 PM
damo   No pbs, i'll continu my test on the new releas...   Feb 13 2007, 02:08 PM
damo   Thank you Mr Petit for your help. The final use of...   Feb 14 2007, 08:45 AM
kiroukou   I don't think I understand your problem with s...   Feb 14 2007, 09:12 AM
damo   Yes it's from the demo i show you last day. Do...   Feb 14 2007, 10:19 AM
kiroukou   Try to enable the clipping for now. But this will ...   Feb 14 2007, 10:40 AM
sutt   Oops... wrong thread.   Feb 14 2007, 09:08 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 26th July 2007 - 11:03 AM
phpMyVisites