If i add the bitmap material in Flex it tiles the cube incorrectly

if i add the bitmap material in Flash using the new map1(512,512)
property then it tiles it correctly

none of my attempts to recreate this map1(512,512) item in Flex
work....

do I need to import more classes into Flex to make this tile the cube
correctly? Can you highlight how to apply the map1(512,512) property
into Flex..?

thanks again

---- code snippet

                [Embed(source="assets/map1-01.png")]
                private var sky6mat:Class;

...

                private function initMaterials():void {
                var testBM:Bitmap = new sky6mat() as Bitmap;
                material = new BitmapMaterial(testBM.bitmapData);
                trace("Materials initialised");
                }

                private function initObjects():void {
                        cube = new Cube();
                        cube.map6 = true;
                        cube.width = 500;
                        cube.depth = 500;
                        cube.height = 500;
                        cube.flip = false;
                        cube.material = material;
                        scene.addChild(cube);

                trace("Objects initiialised");
                }
---- end code snippet


On Aug 31, 9:47 am, Fabrice3D <[email protected]> wrote:
> just tested this morning using your map,
> works just fine. I presume the bad guys is as said earlyer your  
> TransformMaterial.
>
> var mat:BitmapMaterial = new BitmapMaterial(new map1(512,512));               
>  
> var cube:Cube = new Cube({map6:true, width:500, height:500, depth:500,  
> material:mat});                
> _view.scene.addChild(cube);
>
> Fabrice
>
> On Aug 30, 2009, at 10:40 PM, morphean wrote:
>
>
>
>
>
> > Yup I took yours and Peters advice to target f10, much faster.. ;)
>
> > On Aug 30, 9:23 pm, Fabrice3D <[email protected]> wrote:
> >> This demo says you must do something 
> >> wrong...http://www.closier.nl/playground/cubeprops.swf
>
> >> I will test it asap just to make sure, F10 right?
>
> >> Fabrice
> >> On Aug 30, 2009, at 10:06 PM, morphean wrote:
>
> >>> thats what I mean i think there is a bug since the cube only shows 3
> >>> of the surfaces not all 6..
>
> >>> should I post something in the bug tracker??
>
> >>> On Aug 30, 8:46 pm, Fabrice3D <[email protected]> wrote:
> >>>> I do not know from memory if the order is ok, but you should see  
> >>>> each
> >>>> colors displayed on each sides of your cube.
> >>>> using bitmapmaterial, with no transforms.
>
> >>>> Fabrice
>
> >>>> On Aug 30, 2009, at 9:34 PM, morphean wrote:
>
> >>>>> can you confirm that my source bitmap for the map6 property is
> >>>>> correct?
>
> >>>>>http://groups.google.com/group/away3d-dev/web/map1-01.png
>
> >>>>> since it only produces texture on 3 of the sides as per the second
> >>>>> screenshot
>
> >>>>>http://away3d-dev.googlegroups.com/web/Screen%20shot%202009-08-30%20a
> >>>>> ...
>
> >>>>> thanks again
>
> >>>>> On Aug 30, 8:06 pm, Fabrice3D <[email protected]> wrote:
> >>>>>> thats not a bug. that the way it behaves.
> >>>>>> if you do use map 6, your map holds the 6 sides information in  
> >>>>>> one
> >>>>>> single source bitmapdata.
> >>>>>> ideal to make a skybox, the inside of a box...
>
> >>>>>> now you do apply a transform material.
> >>>>>> if you want to show your grid, just pass a bitmapmaterial, and do
> >>>>>> not
> >>>>>> set map6
> >>>>>> then your grid will be set over each sides of the cube.
>
> >>>>>> Fabrice
>
> >>>>>> On Aug 30, 2009, at 2:00 PM, morphean wrote:
>
> >>>>>>> There seems to be a bug in the map6 property for a Cube.
>
> >>>>>>> applying a grid texture shows that it is only wrapping the Left
> >>>>>>> Right
> >>>>>>> and Down parts, and none of the text shows from my Bitmap  
> >>>>>>> texture;
>
> >>>>>>> The Front, Back, and Up sections are not used at all...
>
> >>>>>>> I have posted the materials used. can anyone see what is going
> >>>>>>> wrong
> >>>>>>> here?
>
> >>>>>>>http://groups.google.com/group/away3d-dev/web/map1-01.png
> >>>>>>>http://groups.google.com/group/away3d-dev/web/grid1-01.png
> >>>>>>>http://groups.google.com/group/away3d-dev/web/Screen%20shot%202009-08
> >>>>>>> ...
> >>>>>>>http://groups.google.com/group/away3d-dev/web/Screen%20shot%202009-08
> >>>>>>> ...
>
> >>>>>>> snippet below:
>
> >>>>>>> private function initMaterials():void {
>
> >>>>>>>            //inside = new BitmapMaterial(Cast.bitmap(new
> >>>>>>> fullMap()));
> >>>>>>>            outside = new ColorMaterial(0xffc00);
> >>>>>>>            inside = new TransformBitmapMaterial(Cast.bitmap(new
> >>>>>>> fullMap));
>
> >>>>>>>            }
>
> >>>>>>>            private function initObjects():void {
>
> >>>>>>>            generateCube();
>
> >>>>>>>            }
>
> >>>>>>>            private function initCameraPositions():void {
>
> >>>>>>>            var cameraZpos:Number = (cube1.depth/2)*3.0;
> >>>>>>>            trace(cameraZpos);
> >>>>>>>            //
> >>>>>>>            insideCameraPosition = new
> >>>>>>> Number3D(cube1.x,cube1.y,cameraZpos);
> >>>>>>>            camera.focus = 40;
> >>>>>>>            //camera.pitch(30);
> >>>>>>>            camera.position = insideCameraPosition;
> >>>>>>>            //camera.target = cube1;
>
> >>>>>>>            }
> >>>>>>>            private function initListeners():void {
>
> >>>>>>>            stage.addEventListener(Event.ENTER_FRAME,
> >>>>>>> onEnterFrame);
> >>>>>>>            }
>
> >>>>>>>            private function onEnterFrame(e:Event):void {
> >>>>>>>            view.render();
> >>>>>>>            }
>
> >>>>>>>            private function generateCube():void {
> >>>>>>>            cube1 = new Cube();
> >>>>>>>            cube1.width = cube1.height = cube1.depth = cubeSize;
> >>>>>>>            cube1.name = "cube1";
> >>>>>>>            cube1.material = inside;
> >>>>>>>            inside.scaleX = 1;
> >>>>>>>            inside.scaleY = 1;
> >>>>>>>            cube1.back = outside;
> >>>>>>>            cube1.map6 = true;
> >>>>>>>            cube1.flip = false;
>
> >>>>>>>            //cube1.bothsides = true;
> >>>>>>>            cube1.rotationX = 45;
> >>>>>>>            cube1.rotationY = 45;
> >>>>>>>            cube1.addOnMouseOver(onRollOver);
> >>>>>>>            cube1.addOnMouseOut(onRollOut);
> >>>>>>>            scene.addChild(cube1);
> >>>>>>>            }
>
> >>>>>>> can anyone shed any light on what is going on here, i am going  
> >>>>>>> to
> >>>>>>> try
> >>>>>>> this with some older releases.

Reply via email to