Difference between revisions of "Simulating a Mirror"

From SIMboxWiki
Jump to navigation Jump to search
(Created page with 'The following method is suggested to simulate a mirror display: 1. Render the world in the opposite direction of the cockpit using a Video Camera.<br>2…')
 
Line 1: Line 1:
 
The following method is suggested to simulate a mirror display:  
 
The following method is suggested to simulate a mirror display:  
  
1. Render the world in the opposite direction of the cockpit using a [[Video Camera Example|Video Camera.]]<br>2. Attach the video camera to an AGI.<br>3. Limit the size of the AGI either using a texture mask or a clip mask.<br>4. Flip the AGI or the image horizontally (assuming you rotated the camera backwards using yaw) using either [[Scale|Agi::Scale()]] with -1 as the horizontal scale or Agi::FlipBitmap().  
+
1. Render the world in the opposite direction of the cockpit using a [[Video Camera Example|Video Camera.]]<br>2. Attach the video camera to an AGI.<br>3. Limit the size of the AGI either using a texture mask or a clip mask (see [[Fitting_an_AGI_to_a_Gauge]]).<br>4. Flip the AGI or the image horizontally (assuming you rotated the camera backwards using yaw) using either [[Scale|Agi::Scale()]] with -1 as the horizontal scale or Agi::FlipBitmap().  
  
 
Two items to note:<br>1. If you have more than one mirror, it is advised that you use the same video camera on both to save performance. <br>2. The result of the above steps won't truly simulate how mirrors work. Mirrors reflect things relative to the position of the eye (i.e. camera) from the mirror. If you want to take this into account, you will have to add the necessary calculations and you will not be able to use the same video camera for multiple mirrors.<br>  
 
Two items to note:<br>1. If you have more than one mirror, it is advised that you use the same video camera on both to save performance. <br>2. The result of the above steps won't truly simulate how mirrors work. Mirrors reflect things relative to the position of the eye (i.e. camera) from the mirror. If you want to take this into account, you will have to add the necessary calculations and you will not be able to use the same video camera for multiple mirrors.<br>  
  
 
[[Category:Development_Articles]] [[Category:Console_Object_Component]]
 
[[Category:Development_Articles]] [[Category:Console_Object_Component]]

Revision as of 19:51, 17 April 2013

The following method is suggested to simulate a mirror display:

1. Render the world in the opposite direction of the cockpit using a Video Camera.
2. Attach the video camera to an AGI.
3. Limit the size of the AGI either using a texture mask or a clip mask (see Fitting_an_AGI_to_a_Gauge).
4. Flip the AGI or the image horizontally (assuming you rotated the camera backwards using yaw) using either Agi::Scale() with -1 as the horizontal scale or Agi::FlipBitmap().

Two items to note:
1. If you have more than one mirror, it is advised that you use the same video camera on both to save performance.
2. The result of the above steps won't truly simulate how mirrors work. Mirrors reflect things relative to the position of the eye (i.e. camera) from the mirror. If you want to take this into account, you will have to add the necessary calculations and you will not be able to use the same video camera for multiple mirrors.