Sky Box

This forum is currently in read-only mode.
From the Asset Store
Set of 10 Parralax Backgrounds to make pixel art game.
  • There are two boxes because... I don't know, David just wanted another box in the scene to spin around? I guess.

    And the script doesn't create the skybox effect, the sky texture on the box creates the skybox effect. Hence the term "skybox." It's a sky... on a box.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks pal.

    How does the thing work though? Like, why are there two boxes, and how does the script create the skybox effect?

    If you've ever used a 3D application like 3D max or Maya, you'll probably know that a 3D model, even something as simple as a cube, can be textured one-sided or both sides.

    In 3D modelling, especially rendering a scene, it's simple to create a square room by either texturing both sides of the cube or by flipping the normals so that the textures show on the opposite side of the polygons, so that when the camera is inside the cube, you have your room.

    If you enlarge this, it can be used as a skybox that encapsulates your whole scene.

    The 3D box in Construct textures both sides of the polygons, so by expanding the size of the cube (the three "start of layout" commands) you push the faces so far out that you can never see them with the camera because they're actually far behind your camera view, and you're effectively always seeing the inside of the cube.

    Then you have the simple code that determines the cubes rotation dependant on the mouse.

    If you change the initial sizing code for the cube to:

    + System: Start of layout

    -> 3DBox: Set width to.Width * 10

    -> 3DBox: Set height to.height * 10

    -> 3DBox: Set depth to.depth * 10

    ...you'll see the effect clearly, and it will be obvious that you're looking at the inside of the cube.

    I think David just put the other box in there as a reference to the rotation of the outer box for those who wanted to know how it was moving.

    HTH,

    Krush.

  • Oh, so the box is just huge and encapsulates the player, camera and level completely?

  • Oh, so the box is just huge and encapsulates the player, camera and level completely?

    Yep.

    Like I said, change the 100 to 10 at the start and you'll be able to see the cube clipping as you rotate.

    By setting it to 100, it meant that the edges of the cube could never touch the camera as long as it was rotating around it's centre, which it is.

    Krush.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)