Package com.jme3.scene.shape

Examples of com.jme3.scene.shape.Quad


public class TestCollector {

    public static void main(String[] args){
        Vector3f z = Vector3f.ZERO;
        Geometry g  = new Geometry("quad", new Quad(2,2));
        Geometry g2 = new Geometry("quad", new Quad(2,2));
        List<OCTTriangle> tris = new ArrayList<OCTTriangle>();
        tris.add(new OCTTriangle(z, z, z, 1, 0));
        tris.add(new OCTTriangle(z, z, z, 0, 1));
        List<Geometry> firstOne = TriangleCollector.gatherTris(new Geometry[]{ g, g2 }, tris);
        System.out.println(firstOne.get(0).getMesh());
View Full Code Here


    float distance = c.getFrustumFar();
    float scale = distance / c.getFrustumNear();
    distance = distance * (255f / 256f);
    width *= scale;
    height *= scale;
    geom = new Geometry("SkyPlane", new Quad(width, height));
    geom.setLocalRotation(Quaternion.DIRECTION_Z.opposite());
    geom.setLocalTranslation(c.getDirection().mult(-distance).add(new Vector3f(-width / 2, height / 2, 0)));
    geom.setMaterial(mat);
    camNode.attachChild(geom);
  }
View Full Code Here

        generateImageQuad();
    }

    private void generateImageQuad() {
        try {
            plane = new Quad(xSize, ySize, true);
            screen = new Geometry("My " + imageType + " plane", plane);
            //  1920x1080
            imageToProject = new Texture2D(imageX, imageY, jmeformat);
            defaultMat = new Material(gameClient.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
            defaultMat.setTexture("ColorMap", imageToProject);
View Full Code Here

  private Material mat;
  private Geometry atmo;

  @Override
  public void simpleInitApp() {
    Sphere atmoSphere = new Sphere(48, 48, radius, false, true);
    mat = new Material(assetManager, "MatDefs/SimpleAtmoshere.j3md");
   
    mat.setFloat("radius", radius);
    atmo = new Geometry("atmo_Planet", atmoSphere);
   
    Vector3f pos = new Vector3f(5,0,0);
    atmo.setLocalTranslation(pos);
    mat.setVector3("v3Center", pos);
   
   
    atmo.setMaterial(mat);
      rootNode.attachChild(atmo);
     
      Sphere planetSphere = new Sphere(48, 48, radius * 0.8f);
      Material planteMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
      planteMat.setColor("Color", ColorRGBA.Green);
      Geometry planet = new Geometry("geo_Planet", planetSphere);
      planet.setLocalTranslation(pos);
      planet.setMaterial(planteMat);
View Full Code Here

        mat.setColor("m_Specular", ColorRGBA.Red);
       
        teapot.setMaterial(mat);
        rootNode.attachChild(teapot);

        lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        lightMdl.getMesh().setStatic();
        rootNode.attachChild(lightMdl);

        pl = new PointLight();
View Full Code Here

     * Starts the application. Creating a display and running the main loop.
     */
    public void start(){

        if (settings == null){
            settings = new AppSettings(true);
        }
       
        context = JmeSystem.newContext(settings, JmeContext.Type.OffscreenSurface);
        context.setSystemListener(this);
        context.create(false);
View Full Code Here

      new ModelInfo(activeModel, app.getAssetLogger().getKeys(activeModel.getRelPath(workspace)));
    } catch (Exception e) {}
  }

  public static void createCanvas(){
    AppSettings settings = new AppSettings(true);
    settings.setWidth( Math.max(640, frame.getContentPane().getWidth()) );
    settings.setHeight( Math.max(480, frame.getContentPane().getHeight()) );

    app = new EditorApp();

    app.setPauseOnLostFocus(false);
    app.setSettings(settings);
    app.createCanvas();

    context = (JmeCanvasContext) app.getContext();
    canvas = context.getCanvas();
    canvas.setSize(settings.getWidth(), settings.getHeight());
  }
View Full Code Here

   * main for testing
   *
   * @param args
   */
  public static void main(String[] args) {
        AppSettings settings = new AppSettings(true);
        PolluxSettingsDialog.show(settings);
        System.out.println(settings.toString());
        System.exit(0);
  }
View Full Code Here

    }

    @Override
    public void start() {
     
        setSettings(new AppSettings(true));
        PolluxSettingsDialog.show(settings);
       
        super.start();
    }
View Full Code Here

    */
    Geometry g = new Geometry("Bubble", b);
    g.rotate(FastMath.HALF_PI, 0, FastMath.HALF_PI);
    //g.scale(1, 1, -1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    Texture tex = assetManager.loadTexture("Textures/test3.png");
    mat.setTexture("ColorMap", tex);
    //mat.setColor("Color", ColorRGBA.Blue);
    //mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
   
View Full Code Here

TOP

Related Classes of com.jme3.scene.shape.Quad

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.