Package com.jme3.scene.shape

Examples of com.jme3.scene.shape.Quad


    for (int i = 0; i <= samples; i++) {
      float x = FastMath.cos(angle);
      float z = FastMath.sin(angle);
      int verticesBase = i+1;
      int indicesBase = (i-1)*3;
      vertices[verticesBase] = new Vector3f((x * radius) + ref.x, ref.y, (z * radius) + ref.z);
      texCoord[verticesBase] = new Vector2f((x * 0.5f) + 0.5f, rw-(z * rw));
      System.out.println(texCoord[verticesBase]);
      if (lastPoint > 0) {
        indices[indicesBase] = 0;
        indices[indicesBase+1] = verticesBase;
        indices[indicesBase+2] = lastPoint;
      }
      lastPoint = verticesBase;
      angle += rate;
    }
   
    // right center
    ref.z = radius-width/2f;
    int base2 = samples+2;
    vertices[base2] = ref.clone();
   
    float rbw = (width-radius)/width;
    texCoord[base2] = new Vector2f(0.5f, rbw);
    angle = FastMath.PI;
    lastPoint = 0;
   
    // draw right half circle
    for (int i = 0; i <= samples; i++) {
      float x = FastMath.cos(angle);
      float z = FastMath.sin(angle);
      int verticesBase = i+samples+3;
      int indicesBase = (i+samples)*3;
      vertices[verticesBase] = new Vector3f((x * radius) + ref.x, ref.y, (z * radius) + ref.z);
      texCoord[verticesBase] = new Vector2f((x * 0.5f) + 0.5f, 1 - (z * rw));
      if (lastPoint > 0) {
        indices[indicesBase] = base2;
        indices[indicesBase+1] = verticesBase;
        indices[indicesBase+2] = lastPoint;
View Full Code Here


    for (int i = 0; i < samples; i++) {
      float x = FastMath.cos(angle) + center.x;
      float y = FastMath.sin(angle) + center.y;
      int base = i*2;
      int indicesBase = i*6;
      vertices[base] = new Vector3f(x * radius, y * radius, center.z);
      vertices[base+1] = new Vector3f(x * (radius-width), y * (radius-width), center.z);
      texCoord[base] = new Vector2f(x * radius, y * radius);
      texCoord[base+1] = new Vector2f(x * (radius-width), y * (radius-width));
     
      indices[indicesBase] = base;
      indices[indicesBase+1] = calc(base+1);
View Full Code Here

  }

  @Override
  public void onCamLocationChange(Vector3f camLoaction) {
   
        Vector3f newDirection = new Vector3f();
        Vector3f newUp = new Vector3f();
        Vector3f newLeft = new Vector3f();
       
        newDirection.set(camLoaction).subtractLocal(getLocalTranslation()).normalizeLocal();

        newUp.set(Vector3f.UNIT_Y);
       

        newLeft.set(newUp).crossLocal(newDirection).normalizeLocal();
        if (newLeft.equals(Vector3f.ZERO)) {
            if (newDirection.x != 0) {
                newLeft.set(newDirection.y, -newDirection.x, 0f);
            } else {
                newLeft.set(0f, newDirection.z, -newDirection.y);
            }
        }

        newUp.set(newDirection).crossLocal(newLeft).normalizeLocal();
       
View Full Code Here

    for (int i = 0; i <= samples; i++) {
      float x = FastMath.cos(angle);
      float z = FastMath.sin(angle);
      int verticesBase = i+1;
      int indicesBase = (i-1)*3;
      vertices[verticesBase] = new Vector3f((x * radius) + ref.x, ref.y, (z * radius) + ref.z);
      texCoord[verticesBase] = new Vector2f(1-rw+(z * rw), (x * 0.5f) + 0.5f);
      if (lastPoint > 0) {
        indices[indicesBase] = 0;
        indices[indicesBase+1] = verticesBase;
        indices[indicesBase+2] = lastPoint;
      }
      lastPoint = verticesBase;
      angle += rate;
    }
   
    // right center
    ref.z = radius-width/2f;
    int base2 = samples+2;
    vertices[base2] = ref.clone();
   
   
    texCoord[base2] = new Vector2f(rw, 0.5f);
    angle = FastMath.PI;
    lastPoint = 0;
   
    // draw right half circle
    for (int i = 0; i <= samples; i++) {
      float x = FastMath.cos(angle);
      float z = FastMath.sin(angle);
      int verticesBase = i+samples+3;
      int indicesBase = (i+samples)*3;
      vertices[verticesBase] = new Vector3f((x * radius) + ref.x, ref.y, (z * radius) + ref.z);
      texCoord[verticesBase] = new Vector2f(rw + (z * rw), (x * 0.5f) + 0.5f);
      System.out.println(texCoord[verticesBase]);
      if (lastPoint > 0) {
        indices[indicesBase] = base2;
        indices[indicesBase+1] = verticesBase;
View Full Code Here

 
  public void update(float tpf) {
    if (!isFinished()) {
      updateTimer(tpf);
      float p = getProgress();
      Vector3f tar = target.getLocalTranslation();
      Vector3f route = tar.subtract(start);
      route.multLocal(p);
      Vector3f newPos = start.add(route);
      position.setLocalTranslation(newPos);
    }
  }
View Full Code Here

        // init Camera --------------------------------
       
        cam = new Camera(settings.getWidth(), settings.getHeight());

        cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f);
        cam.setLocation(new Vector3f(0f, 0f, 10f));
        cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
       

        renderManager = new RenderManager(renderer);
        //Remy - 09/14/2010 setted the timer in the renderManager
        renderManager.setTimer(timer);
View Full Code Here

  }
 
  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
   
    test = new Planet(app.getAssetManager(), "Earth", "Textures/Planets/Earth/Earth.jpg", "Textures/Planets/Clouds/Cloud1.jpg", 60, new Vector3f(600, 0, 0), true, null);
    mapNode.attachChild(test);
   
    Planet test2 = new Planet(app.getAssetManager(), "Uriel", "Textures/Planets/Uriel/Uriel.jpg", null, 60, new Vector3f(0, 0, 600), false, null);
    mapNode.attachChild(test2);
   
    Planet test3 = new Planet(app.getAssetManager(), "Dominion", "Textures/Planets/Dominion/Dominion.jpg", null, 60, new Vector3f(-600, 0, 0), true, new Vector3f(0.4f, 0.6f, 0.7f));
    mapNode.attachChild(test3);
   
   
    /*
    Planet perun = new Planet("Perun", "perun2.jpg", 60);
View Full Code Here

  public void addBloomFilter() {
    this.enqueue(new Callable<Integer>(){

      public Integer call() throws Exception {
        if (bloomFilter == null) {
          bloomFilter = new FilterPostProcessor(assetManager);
          BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
          bf.setBloomIntensity(2.0f);
          bf.setExposurePower(1.3f);
          bloomFilter.addFilter(bf);
          @SuppressWarnings("unused")
View Full Code Here

    this.enqueue(new Callable<Integer>(){

      public Integer call() throws Exception {
        if (bloomFilter == null) {
          bloomFilter = new FilterPostProcessor(assetManager);
          BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
          bf.setBloomIntensity(2.0f);
          bf.setExposurePower(1.3f);
          bloomFilter.addFilter(bf);
          @SuppressWarnings("unused")
          BloomUI bui = new BloomUI(inputManager, bf);
        }
        viewPort.addProcessor(bloomFilter);
View Full Code Here

      
        renderer = context.getRenderer();
       
        // init Camera --------------------------------
       
        cam = new Camera(settings.getWidth(), settings.getHeight());

        cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f);
        cam.setLocation(new Vector3f(0f, 0f, 10f));
        cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
       

        renderManager = new RenderManager(renderer);
        //Remy - 09/14/2010 setted the timer in the renderManager
        renderManager.setTimer(timer);
        viewPort = renderManager.createMainView("Default", cam);
        viewPort.setClearEnabled(true);

        // Create a new cam for the gui
        Camera guiCam = new Camera(settings.getWidth(), settings.getHeight());
        guiViewPort = renderManager.createPostView("Gui Default", guiCam);
        guiViewPort.setClearEnabled(false);
       
        // init Input ----------------------------------
       
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.