public void setModel(ArModel model, double[] translate, double[] rotate, double scale) {
		if (model != null) {
			if (models.containsKey(model.getMarkerCode())) {
				List<ArModel> list = models.get(model.getMarkerCode());
				boolean found = false;
				for (int i = 0; i < list.size() && !found; i++) {
					if (!list.get(i).isRendered()) {
						ArModel m = list.get(i);
						m.setRendered(true);
						Transform3D rot = createTransform(translate, rotate, scale);
						transforms.get(model.getMarkerCode()).get(i).setTransform(rot);
						found = true;
					}
				}
				if (!found) {
					model.setRendered(true);
					LinkedList<ArModel> modelList = models.get(model.getMarkerCode());
					LinkedList<TransformGroup> groupList = transforms.get(model.getMarkerCode());
					LinkedList<BranchGroup> innerList = innerContents.get(model.getMarkerCode());
					modelList.add(model);
					Transform3D rot = createTransform(translate, rotate, scale);
					TransformGroup tg = new TransformGroup();
					tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
					tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
					tg.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
					tg.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
					tg.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
					tg.setTransform(rot);
					tg.addChild(model.getModel());
					groupList.add(tg);
					BranchGroup innerContent = new BranchGroup();
					innerContent.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
					innerContent.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
					innerContent.setCapability(BranchGroup.ALLOW_DETACH);
					innerList.add(innerContent);
					innerContent.addChild(tg);
					scene.addChild(innerContent);
				}
			} else {
				model.setRendered(true);
				LinkedList<ArModel> modelList = new LinkedList<>();
				LinkedList<TransformGroup> groupList = new LinkedList<>();
				LinkedList<BranchGroup> innerList = new LinkedList<>();
				modelList.add(model);
				Transform3D rot = createTransform(translate, rotate, scale);
				TransformGroup tg = new TransformGroup();
				tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
				tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
				tg.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
				tg.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
				tg.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
				tg.setTransform(rot);
				tg.addChild(model.getModel());
				groupList.add(tg);
				BranchGroup innerContent = new BranchGroup();
				innerContent.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
				innerContent.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
				innerContent.setCapability(BranchGroup.ALLOW_DETACH);
				innerList.add(innerContent);
				innerContent.addChild(tg);
				innerContents.put(model.getMarkerCode(), innerList);
				models.put(model.getMarkerCode(), modelList);
				transforms.put(model.getMarkerCode(), groupList);
				scene.addChild(innerContent);
			}
		}
	}