material - map6

3 views
Skip to first unread message

morphean

unread,
Aug 30, 2009, 8:00:54 AM8/30/09
to away3d.dev
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-30%20at%2012.50.17.png
http://groups.google.com/group/away3d-dev/web/Screen%20shot%202009-08-30%20at%2012.46.46.png

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.

Fabrice3D

unread,
Aug 30, 2009, 3:06:56 PM8/30/09
to away3...@googlegroups.com
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

morphean

unread,
Aug 30, 2009, 3:34:06 PM8/30/09
to away3d.dev
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%20at%2012.50.17.png

thanks again



On Aug 30, 8:06 pm, Fabrice3D <fabric...@gmail.com> 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...

Fabrice3D

unread,
Aug 30, 2009, 3:46:45 PM8/30/09
to away3...@googlegroups.com
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

morphean

unread,
Aug 30, 2009, 4:06:21 PM8/30/09
to away3d.dev
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 <fabric...@gmail.com> 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...

Fabrice3D

unread,
Aug 30, 2009, 4:23:05 PM8/30/09
to away3...@googlegroups.com
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

morphean

unread,
Aug 30, 2009, 4:40:16 PM8/30/09
to away3d.dev
spot on, can I see your source for that and the maps so that I can see
where I am going wrong??

thanks again for the fast response


On Aug 30, 9:23 pm, Fabrice3D <fabric...@gmail.com> wrote:
> This demo says you must do something wrong...http://www.closier.nl/playground/cubeprops.swf

morphean

unread,
Aug 30, 2009, 4:40:58 PM8/30/09
to away3d.dev
Yup I took yours and Peters advice to target f10, much faster.. ;)

On Aug 30, 9:23 pm, Fabrice3D <fabric...@gmail.com> wrote:
> This demo says you must do something wrong...http://www.closier.nl/playground/cubeprops.swf

Fabrice3D

unread,
Aug 31, 2009, 4:47:50 AM8/31/09
to away3...@googlegroups.com
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

morphean

unread,
Aug 31, 2009, 10:50:10 AM8/31/09
to away3d.dev
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
Reply all
Reply to author
Forward
0 new messages