outputObject.addGeometry(geometry);
} else if (geometry instanceof Point) {
geometryType = GeometryType.POINT;
if (points == null) {
points = new XML3DNode("objects");
xml3dRootNode.addXML3DNode(points);
}
if (mesh_ref != null) {
// Create new XML3DNode and add it to the XML3D points node
XML3DNode point = new XML3DNode("group");
points.addXML3DNode(point);
point.addXML3DAttribute(new XML3DAttribute("id", id));
Coordinate coordinate = geometry.getCoordinate();
// Transform coordinates to relative coordinates which are calculated from request
// bounding box.
double minX = boundingBox.getLowerCorner().getCoordinate()[0]; // Min X
double minY = boundingBox.getLowerCorner().getCoordinate()[1]; // Min Y
point.addXML3DAttribute(new XML3DAttribute("translation", String.valueOf(coordinate.x
- minX)
+ " "
+ String.valueOf(coordinate.z)
+ " "
+ String.valueOf(coordinate.y - minY)));
XML3DNode node = new XML3DNode("mesh");
XML3DAttribute mesh_src = new XML3DAttribute("src", mesh_ref);
node.addXML3DAttribute(mesh_src);
point.addXML3DNode(node);
} else {
// XML3D doesn't support drawing of points and therefore point geometry should be used
// only for external mesh references