Skip to content

Commit 7350576

Browse files
author
SimBlocks
committed
Added Tutorial.md section "Using a Controller to Move the Camera" and updated the "Object Placement" section.
1 parent c4ded5c commit 7350576

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

docs/Tutorial.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ The section on floating origin is required reading.
103103

104104
There are various ways to position an object in the OWSDK.
105105

106-
## Geocentric Coordinates
106+
### Geocentric Coordinates
107107
If you have the Geocentric coordinates of an object you wish to place in the world, then placing it is a matter of calculating its Unity position using the WorldOrigin of the IRTOContext. For stationary objects, the MonoBehaviour GeocentricTransform may be used.
108108

109-
## WGS84 Coordinates
109+
### WGS84 Coordinates
110110
When using lat, lon, the process is the same, but additionally requires using the Ellipsoid in use to calculate the Geocentric position. A MonoBehaviour GeoTransform allows setting object position using Geodetic3d coordinates directly. Additionally, GeoTransform will calculate the appropriate Up orientation to establish a local-to-the-ground Up direction for the GameObject.
111111

112+
![GeoTransform Settings](images/GeotransformSettings.png)
113+
![GameObject On Globe](images/PlacingTeapotInWorld.png)
114+
115+
The settings for the GeoTransform MonoBehaviour are shown above. Don't forget to set the WorldContext on the GeoTransform!
116+
112117
To transform from a WGS84 coordinate (expressed as lat,lon,elevation):
113118

114119
```
@@ -170,3 +175,7 @@ So, for example, if you have your exe built here:
170175
the config file must be in the location:
171176

172177
"<root>\data\OneWorldSDK\_Viewer.config.json"
178+
179+
## Using a Controller to Move the Camera
180+
181+
We use Unity's [Input Manager](https://docs.unity3d.com/Manual/class-InputManager.html) to control the globe which makes it easy for you to make your own controls. It can be found by going to Edit -> Project Settings... The axis labled *Horizontal* is used for moving moving left and right (increasing or decreasing longitude). You can modify the Positive/Negative buttons. Similarly, the *UpDown* axis is used for decreasing/increasing altitude. The source code that manipulates camera movement is [src/OneWorldSDK_UnityDemo/Assets/UnityDemo/Scripts/WorldObjectMovement.cs](../src/OneWorldSDK_UnityDemo/Assets/UnityDemo/Scripts/WorldObjectMovement.cs).
25.1 KB
Loading
218 KB
Loading

0 commit comments

Comments
 (0)