Reference:Screen.inc

From POV-Wiki
Jump to navigation Jump to search

Screen.inc will enable you to place objects and textures right in front of the camera. When you move the camera, the objects placed with screen.inc will follow the movement and stay in the same position on the screen. One use of this is to place your signature or a logo in the corner of the image.

You can only use screen.inc with the perspective camera. Screen.inc will automatically create a default camera definition for you when it is included. All aspects of the camera can than be changed, by invoking the appropriate 'Set_Camera_...' macros in your scene. After calling these setup macros you can use the macros Screen_Object and Screen_Plane.

Note: Even though objects aligned using screen.inc follow the camera, they are still part of the scene. That means that they will be affected by perspective, lighting, the surroundings etc.

For an example of use, see the screen.pov demo file.

Set_Camera_Location(Loc): Changes the position of the default camera to a new location as specified by the Loc vector.

Set_Camera_Look_At(LookAt): Changes the position the default camera looks at to a new location as specified by the LookAt vector.

Set_Camera_Aspect_Ratio(Aspect): Changes the default aspect ratio, Aspect is a float value, usually width divided by the height of the image.

Set_Camera_Aspect(Width,Height): Changes the default aspect ratio of the camera.

Set_Camera_Sky(Sky): Sets a new Sky-vector for the camera.

Set_Camera_Zoom(Zoom): The amount to zoom in or out, Zoom is a float.

Set_Camera_Angle(Angle): Sets a new camera angle.

Set_Camera(Location, LookAt, Angle): Set location, look_at and angle in one go.

Reset_Camera(): Resets the camera to its default values.

Screen_Object (Object, Position, Spacing, Confine, Scaling): Puts an object in front of the camera.

Parameters:

  • Object = The object to place in front of the screen.
  • Position = UV coordinates for the object. <0,0> is lower left corner of the screen and <1,1> is upper right corner.
  • Spacing = Float describing minimum distance from object to the borders. UV vector can be used to get different horizontal and vertical spacing.
  • Confine = Set to true to confine objects to visible screen area. Set to false to allow objects to be outside visible screen area.
  • Scaling = If the object intersects or interacts with the scene, try to move it closer to the camera by decreasing Scaling.

Screen_Plane (Texture, Scaling, BLCorner, TRCorner): Screen_Plane is a macro that will place a texture of your choice on a plane right in front of the camera.

Parameters:

  • Texture = The texture to be displayed on the camera plane. <0,0,0> is lower left corner and <1,1,0> is upper right corner.
  • Scaling = If the plane intersects or interacts with the scene, try to move it closer to the camera by decreasing Scaling.
  • BLCorner = The bottom left corner of the Screen_Plane.
  • TRCorner = The top right corner of the Screen_Plane.