Package com.jme.scene

Examples of com.jme.scene.SharedMesh


        }
        List<Vector3f> linesPoint = new ArrayList<Vector3f>(count);
        float halfBoxSize = boxSize * 0.5f;
        for (int i = 0; i < count; i++) {
            int index = r.nextInt(5);
            SharedMesh sharedMesh = new SharedMesh(triMesh[index].getName() + "_" + i, triMesh[index]);
            sharedMesh.setLocalTranslation(r.nextInt(boxSize) - halfBoxSize + center.x, r.nextInt(boxSize) - halfBoxSize + center.y, r.nextInt(boxSize) - halfBoxSize + center.z);
            sharedMesh.setLocalRotation(sharedMesh.getLocalRotation().fromAngles(r.nextInt(100), r.nextInt(100), r.nextInt(100)));
            sharedMesh.setLocalScale(r.nextInt(50) * 0.1f);
            MaterialState ms = renderer.createMaterialState();
            linesPoint.add(sharedMesh.getLocalTranslation());

            if (useTransparency) {
                ms.setDiffuse(new ColorRGBA(r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, (r.nextInt(40) + 60) * 0.01f));
            } else {
                ms.setDiffuse(new ColorRGBA(r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, 1));
            }
            sharedMesh.setRenderState(ms);
            sharedMesh.updateModelBound();
            //sharedMesh.lock();
            subNode[index].attachChild(sharedMesh);
        }
        //Line line = new Line("line" , linesPoint.toArray(new Vector3f[linesPoint.size()]),null,null,null);
        //line.setMode(Line.Mode.Connected);
View Full Code Here

TOP

Related Classes of com.jme.scene.SharedMesh

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.