- /**
- * Create all the latitude and longitude lines on the base plane
- * @param inModel model containing data
- * @return Group object containing cylinders for lat and long lines
- */
- private static Group createLatLongs(ThreeDModel inModel)
- {
- Group group = new Group();
- int numlines = inModel.getLatitudeLines().length;
- for (int i=0; i<numlines; i++)
- {
- group.addChild(createLatLine(inModel.getScaledLatitudeLine(i), inModel.getModelSize()));
- }
- numlines = inModel.getLongitudeLines().length;
- for (int i=0; i<numlines; i++)
- {
- group.addChild(createLonLine(inModel.getScaledLongitudeLine(i), inModel.getModelSize()));
- }
- return group;
- }
-
-
- /**
- * Make a single latitude line for the specified latitude
- * @param inLatitude latitude in scaled units
- * @param inSize size of model, for length of line
- * @return Group object containing cylinder for latitude line
- */
- private static Group createLatLine(double inLatitude, double inSize)
- {
- Cylinder latline = new Cylinder(0.1f, (float) (inSize*2));
- Transform3D horizShift = new Transform3D();
- horizShift.setTranslation(new Vector3d(0.0, 0.0, -inLatitude));
- TransformGroup horizTrans = new TransformGroup(horizShift);
- Transform3D zRot = new Transform3D();
- zRot.rotZ(Math.toRadians(90.0));
- TransformGroup zTrans = new TransformGroup(zRot);
- horizTrans.addChild(zTrans);
- zTrans.addChild(latline);
- return horizTrans;
- }
-
-
- /**
- * Make a single longitude line for the specified longitude
- * @param inLongitude longitude in scaled units
- * @param inSize size of model, for length of line
- * @return Group object containing cylinder for longitude line
- */
- private static Group createLonLine(double inLongitude, double inSize)
- {
- Cylinder lonline = new Cylinder(0.1f, (float) (inSize*2));
- Transform3D horizShift = new Transform3D();
- horizShift.setTranslation(new Vector3d(inLongitude, 0.0, 0.0));
- TransformGroup horizTrans = new TransformGroup(horizShift);
- Transform3D xRot = new Transform3D();
- xRot.rotX(Math.toRadians(90.0));
- TransformGroup xTrans = new TransformGroup(xRot);
- horizTrans.addChild(xTrans);
- xTrans.addChild(lonline);
- return horizTrans;
- }
-
-