1 /*******************************************************************************
\r
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.proconf.g3d.shapes;
\r
13 import com.jme.renderer.ColorRGBA;
\r
14 import com.jme.renderer.Renderer;
\r
15 import com.jme.scene.Geometry;
\r
16 import com.jme.scene.Line;
\r
17 import com.jme.scene.state.MaterialState;
\r
18 import com.jme.util.geom.BufferUtils;
\r
20 public class AxesShape {
\r
23 public static Geometry getShape(Renderer renderer) {
\r
24 float[] coords = new float[]{0.f,0.f,0.f,
\r
30 float colors[] = new float[]{1.f,0.f,0.f,0.f,
\r
38 Line shape = new Line("",BufferUtils.createFloatBuffer(coords),null,BufferUtils.createFloatBuffer(colors),null);
\r
39 shape.setMode(Line.SEGMENTS);
\r
40 shape.setIsCollidable(false);
\r
41 shape.setLineWidth(3.f);
\r
42 MaterialState ms = renderer.createMaterialState();
\r
43 ms.setColorMaterial(MaterialState.CM_EMISSIVE);
\r
44 ms.setEmissive(new ColorRGBA(1.f,1.f,1.f,1.f));
\r
45 shape.setRenderState(ms);
\r