Skip to content

Commit 4b5f1ab

Browse files
committed
Reordered main function to make it more tutorial-like
- Added link to COLLADA's official website. - Added comments to distinguish coordinates related to camera from coordinates related to the 3D model. - Changed single line comments to the corresponding bracket. - Made reference to the CU Macky Auditorium on its position.
1 parent d2e8561 commit 4b5f1ab

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/gov/nasa/worldwindx/examples/ColladaViewer.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import java.io.File;
4343

4444
/**
45-
* Shows how to load COLLADA models.
45+
* Shows how to load {@link <a href="https://www.khronos.org/collada/">COLLADA</a> 3D models.
4646
*/
4747
public class ColladaViewer extends ApplicationTemplate {
4848

@@ -83,23 +83,17 @@ protected void addColladaLayer(ColladaRoot colladaRoot) {
8383
}
8484
}
8585

86-
/**
87-
* A <code>Thread</code> that loads a COLLADA file and displays it in an <code>AppFrame</code>.
88-
*/
86+
// A <code>Thread</code> that loads a COLLADA file and displays it in an <code>AppFrame</code>.
8987
public static class WorkerThread extends Thread {
9088

91-
/**
92-
* Indicates the source of the COLLADA file loaded by this thread. Initialized during construction.
93-
*/
89+
// Indicates the source of the COLLADA file loaded by this thread. Initialized during construction.
9490
protected Object colladaSource;
95-
/**
96-
* Geographic position of the COLLADA model.
97-
*/
91+
92+
// Geographic position of the COLLADA model.
9893
protected Position position;
99-
/**
100-
* Indicates the <code>AppFrame</code> the COLLADA file content is displayed in. Initialized during
101-
* construction.
102-
*/
94+
95+
// Indicates the <code>AppFrame</code> the COLLADA file content is displayed in. Initialized during
96+
// construction.
10397
protected AppFrame appFrame;
10498

10599
/**
@@ -137,17 +131,22 @@ public void run() {
137131
}
138132
}
139133
}
140-
134+
141135
public static void main(String[] args) {
136+
137+
// Set camera position and pitch angle.
142138
Configuration.setValue(AVKey.INITIAL_LATITUDE, 40.028);
143139
Configuration.setValue(AVKey.INITIAL_LONGITUDE, -105.27284091410579);
144140
Configuration.setValue(AVKey.INITIAL_ALTITUDE, 4000);
145141
Configuration.setValue(AVKey.INITIAL_PITCH, 50);
146-
142+
143+
// Set the application frame to update, a position for the model, and a path to the COLLADA file.
147144
final AppFrame af = (AppFrame) start("WorldWind COLLADA Viewer", AppFrame.class);
148-
149-
new WorkerThread(new File("testData/collada/cu_macky/CU Macky.dae"),
150-
Position.fromDegrees(40.009993372683, -105.272774533734), af).start();
145+
final Position MackyAuditoriumPosition = Position.fromDegrees(40.009993372683, -105.272774533734);
146+
final File ColladaFile = new File("testData/collada/cu_macky/CU Macky.dae");
147+
148+
// Invoque the <code>Thread</code> to load the COLLADA model asynchronously.
149+
new WorkerThread(ColladaFile, MackyAuditoriumPosition, af).start();
151150

152151
}
153152
}

0 commit comments

Comments
 (0)