Skybox issue

51 views
Skip to first unread message

Apprentice

unread,
Apr 29, 2011, 8:52:32 AM4/29/11
to Away3D.dev
It seems the skybox is a static box that does not move with the
camera: when the camera is moved forward (say camera.lens.far /
Math.sqrt(3) ;) ) we move through the skybox. I tried changing the
skybox position to equal the camera position, but that does not seem
to work. Is there something obvious (or less obvious) I'm missing? Or
is this not yet implemented in the alpha stage?
As a work-around I suppose I could create my own skybox of course.

Fabrice3D

unread,
Apr 29, 2011, 9:11:34 AM4/29/11
to away3...@googlegroups.com
thats the point of a skybox... the term sky means more "so_far_away_that_it_doesn't_move"
but that would be a louzy classname.

if you need to simulate "not that far" distances use either real geometry or if you are not affraid to get ugly bitmap artefacts
use an inverted cube or sphere.

Fabrice

Apprentice

unread,
Apr 29, 2011, 9:50:40 AM4/29/11
to Away3D.dev
Well sure, but then why was the skybox unit cube (though technically
not a unit cube) scaled by only camera.lens.far/Math.sqrt(3)? That is
not far away enough as the camera.lens.far is used to avoid rendering
everything in the scene and therefore not quite
"so_far_away_that_it_doesn't_move".

Fabrice3D

unread,
Apr 29, 2011, 10:12:28 AM4/29/11
to away3...@googlegroups.com
Oh I see now, that's a good point...

DerSchmale

unread,
Apr 29, 2011, 10:44:46 AM4/29/11
to Away3D.dev
Hi,

The SkyBox is a special case in the scene graph, and as such it's
dealt with differently (and more efficiently). It actually ignores
view and scene position, which eventually means that it's at (0, 0, 0)
in view space (ie: centered at the camera). It's size is also
automatically adjusted to the far plane, so it should always fit. Are
you seeing skybox clipping? Because that would imply something else is
wrong, possibly an imprecision with the depth buffer.

Cheers
David

Apprentice

unread,
May 2, 2011, 3:50:27 AM5/2/11
to Away3D.dev
Hello,

Sorry I was away for the weekend.
I believe I have found the problem: I parent my camera to an object
and move this object around.
For some reason this appears to break the skybox being a special case
in the scene graph (I guess).

This is done by setting up a skybox and an object (such as a cube).
Set camera.lens.far to 1000. Then parent the camera to the object. In
EnterFrame move the object (and keep parenting the camera to the
object every frame or it won't update) by say 10 on any axis and
you'll notice the skybox moving until after ~100 frames we move
through the skybox.

I tried adding a link to an image in this post, but it won't let me
post it.

-- Apprentice

Apprentice

unread,
May 10, 2011, 10:01:30 AM5/10/11
to Away3D.dev
Guess I'll have to work around it then.

On 2 mei, 09:50, Apprentice <s.r.r.stiefelha...@gmail.com> wrote:
> Hello,
>
> Sorry I was away for the weekend.
> I believe I have found the problem: I parent my camera to an object
> and move this object around.
> For some reason this appears to break theskyboxbeing a special case
> in the scene graph (I guess).
>
> This is done by setting up askyboxand an object (such as a cube).
> Set camera.lens.far to 1000. Then parent the camera to the object. In
> EnterFrame move the object (and keep parenting the camera to the
> object every frame or it won't update) by say 10 on any axis and
> you'll notice theskyboxmoving until after ~100 frames we move
> through theskybox.
>
> I tried adding a link to an image in this post, but it won't let me
> post it.
>
> -- Apprentice
>
> On 29 apr, 16:44, DerSchmale <david.lenae...@gmail.com> wrote:
>
> > Hi,
>
> > TheSkyBoxis a special case in the scene graph, and as such it's
> > dealt with differently (and more efficiently). It actually ignores
> > view and scene position, which eventually means that it's at (0, 0, 0)
> > in view space (ie: centered at the camera). It's size is also
> > automatically adjusted to the far plane, so it should always fit. Are
> > you seeingskyboxclipping? Because that would imply something else is
Reply all
Reply to author
Forward
0 new messages