Screen to World Projection

Screen to World Projection

File Details

Screen to World Projection Example Map v1.1

  • R
  • Feb 25, 2011
  • 91.98 KB
  • 589

File Name

UI_Screen_To_World_Projection.SC2Map

Supported Versions

    Optimized Code, runs much faster.

    Added an initialization function that must be run every time camera position/orientation changes.

    Controls

    Right click: mouse free look (changes Yaw/Pitch)

    Q/E FoV

    W/S Distance to target

    A/D Roll

    Mouse side buttons: height offset

    UI to World only works properly on flat terrain

    Bugs out at Yaw = 0

    World to UI needs camera smoothing to be OFF to work properly on bumpy terrain

    Both functions need to know Screen Resolution

    Return value from World to UI is in units of resolution. Needs to be converted to UI units to work with dialogs. Can use either the provided resolution detection method or getResolution library (not tested).