![]() 2D objects will still remain flat regardless of the vanishing point.Ĭhanging the vanishing point can be useful to adapt the 3D perspective to match the style of your game. It essentially only changes the direction of the Z axis. Note that changing the vanishing point does not actually change the camera angle. The given position is relative to the viewport, with (0%, 0%) being the top-left corner of the viewport, and (100%, 100%) being the bottom-right corner of the viewport. The vanishing point can be altered via the Vanishing point layout property and the Set layout vanishing point system action. By default the vanishing point is in the middle of the viewport, meaning as objects move in to the distance, they also appear to move towards the middle of the screen. The vanishing point determines how the perspective appears for 3D features. Similarly a Sprite at a Z elevation of -9900 (which is the camera Z position 100 minus the maximum view distance of 10000) will be only just visible, but will completely disappear if any further away. It won't be visible at 99.5, even though that is still in front of the camera (and naturally content behind the camera is not visible). For example with the default camera position at Z=100, the highest a Sprite will be visible is at a Z elevation of 99. Therefore anything closer than 1 unit away from the camera on the Z axis, or further away than 10000 units away on the Z axis, will not be visible. In Construct the minimum distance is 1, and the maximum is 10000. If content is either too close to the camera or too far away, it will disappear. View distanceĭue to the way 3D rendering works, the camera has both a minimum and a maximum distance in side which content is visible. Alternatively you can use the 3D Camera object, which is covered below. For example to set the camera position to 50, you'd set the scale to 100 / 50 = 2. However you can reverse the calculation and set the scale to 100 / z. If you wish to set the camera Z position directly, you still have to use the Set layout/layer scale actions based on a 2D scale factor. ![]() For example if scale is 2, for 2x scale, the camera position is 100 / 2 = 50. The camera Z position for a 2D scale factor can be calculated with 100 / scale. This means scale/zoom is a true 3D effect in Construct, rather than just stretching everything bigger. For example you'll notice Z elevated sprites moving in the view to reflect their position relative to the camera. However there is an additional 3D side-effect to this: since the camera is moving on the Z axis, the perspective of 3D features changes accordingly. In 2D this does exactly what you expect, and everything scales accordingly. Since the camera is closer to the content by a factor of 2, it appears bigger by a factor of 2. For example at 2x scale (or 200% zoom), the camera is actually moved to a Z position of 50. In Construct, adjusting the layout or layer scale (or in the editor, zooming in and out) actually moves the camera on the Z axis. Similarly moving a sprite to a Z elevation of -100 means it is placed twice as far from the camera, and so appears half as big. Moving a sprite to a Z elevation of 50 means it is placed half-way towards the camera, and so appears twice as big. Visualization of the camera at a Z position of 100 looking down at a layout with 2D content at a Z position of 0 The camera is set up to ensure that objects 100 pixels away from the camera appear at 100% scale, so everything appears as expected for a 2D game. All the normal 2D content of a layout has a Z position of 0 (unless it uses Z elevation). So scrolling is in fact moving the camera around in 2D.īy default the camera starts at a Z position of 100, and points down to look at a Z position of 0. In Construct, scrolling to a position moves both the camera and the position it looks at to the given X and Y co-ordinates. ![]() However the view is actually rendered as a 3D world, with a camera position that determines what is visible. The cameraīeing focused on 2D games, Construct normally refers to scrolling and scale when describing which part of the layout is visible and how big it appears. Placing a series of layers at different Z elevations is a quick way to get an overall 3D appearance in an otherwise 2D game. ![]() This provides an interesting alternative to parallax, using real depth rather than changing the scroll speed. This moves all the objects on the layer up and down on the Z axis. You can also change the Z elevation of entire layers. Some Piggy sprites using Z elevation to show perspective
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |