Problem with coordinates

0 views
Skip to first unread message

Irati

unread,
Dec 15, 2009, 3:19:08 AM12/15/09
to Away3D.dev
Hi!
I'm doing and application that changes from 2D to 3D. I'm showing a
room with the floor, the walls and a window. And the problem is that
when I change to the 3D view, the x coordinate is inverted (y and z
are ok). I mean if the window is suposed to be in the right side of
the wall is positioned in the left side, and the same with the other
shapes.
I'm using the same coordinates to draw in 2D and 3D, the same values.
I have the 3D view.x and view.y set in the middle of the screen.

Any ideas about why this is happening?

Thanks in advance.

Rob Bateman

unread,
Dec 22, 2009, 8:04:30 PM12/22/09
to away3...@googlegroups.com
Hey Irati

are you using the Regular Away3d lib or Lite? one possible cause could be that you have positioned your camera to look at the scene from "behind". teh defaultl camera of teh view is positioned at -1000 along the z axis, which should make sure you don't have this problem. Any more info on your setup would help find the cause

cheers

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

Irati

unread,
Dec 29, 2009, 10:49:12 AM12/29/09
to Away3D.dev
Hi Rob,

First of all thank you for the answer. I think it could be something
related with that, but I'm changing the z position of the camera and
it changes nothing :S
I have rebuilt the project, but nothing happens.

So, I'm using the regular away3d library. I'm not very good explaining
myself, so I'm pasting parts of the code.

Here is were I set the view and the camera:

cam = new HoverCamera3D();
cam.position = new Number3D(0,0,-1000,false);
cam.tiltangle = 30;
cam.mintiltangle = 30;
cam.panangle = 45;
cam.hover();


view3D = new View3D({x:stage.width/2, y:stage.height/2, camera:cam});
var clip:RectangleClipping = new RectangleClipping();
clip.maxX = 325;
clip.minX = -325;
clip.maxY = 225;
clip.minY = -225;

view3D.clipping = clip;

view3D.renderer = Renderer.BASIC;
addChild(view3D);

Then, here you have a part of the code where I add a shape:
var segmentoTemp:Array = new Array();
this.p1 = p1;
this.p2 = p2;

segmentTemp = [new Number3D(p1.x,p1.y,p1.z), new Number3D
(p2.x,p2.y,p2.z)]
pared3D = new SegmentsExtrude(segmentTemp,{axis:"y",subdivision:1,
thickness:w,offset:h,thickness_subdivision:1,flip:true,scaling:
1,
coverall:false,recenter:true,closepath:false,
material:material});
view3D.scene.addChild(pared3D);

I think the code is almost the same for all the shapes, so I won't
post the others.
Any ideas?

cheers

Irati.

On 23 dic, 02:04, Rob Bateman <rob.bate...@gmail.com> wrote:
> Hey Irati
>
> are you using the Regular Away3d lib or Lite? one possible cause could be
> that you have positioned your camera to look at the scene from "behind". teh
> defaultl camera of teh view is positioned at -1000 along the z axis, which
> should make sure you don't have this problem. Any more info on your setup
> would help find the cause
>
> cheers
>
> Rob
>

> On Tue, Dec 15, 2009 at 8:19 AM, Irati <irati1...@gmail.com> wrote:
> > Hi!
> > I'm doing and application that changes from 2D to 3D. I'm showing a
> > room with the floor, the walls and a window. And the problem is that
> > when I change to the 3D view, the x coordinate is inverted (y and z
> > are ok). I mean if the window is suposed to be in the right side of
> > the wall is positioned in the left side, and the same with the other
> > shapes.
> > I'm using the same coordinates to draw in 2D and 3D, the same values.
> > I have the 3D view.x and view.y set in the middle of the screen.
>
> > Any ideas about why this is happening?
>
> > Thanks in advance.
>
> --
> Rob Bateman
> Flash Development & Consultancy
>

> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com

Reply all
Reply to author
Forward
0 new messages