Package com.jme.scene

Examples of com.jme.scene.Skybox


                              String south,
                              String east,
                              String west,
                              String up,
                              String down) {
        final Skybox skybox = buildSkybox(north, south, east, west, up, down);
        final DefaultEnvironmentRenderer renderer =
                (DefaultEnvironmentRenderer)getCellRenderer(RendererType.RENDERER_JME);

        SceneWorker.addWorker(new WorkCommit() {
View Full Code Here


                               String southURI,
                               String eastURI,
                               String westURI,
                               String upURI,
                               String downURI) {
        Skybox skybox = new Skybox("skybox", 1000, 1000, 1000);
        try {
//            Vector3f position = null;
//            Cell cell = ClientContextJME.getViewManager().getPrimaryViewCell();
//           
//         
//            CellTransform transform = cell.getLocalTransform();//getLocalCellTransform();
//            position = transform.getTranslation(null);
//           
//            //Unsure if we do this for the skybox or for the entire environment cell.
//            //Let's do it for the skybox for now, and decide later.
//            skybox.setLocalTranslation(position);
           
            LOGGER.fine("Acquiring URLs");
            final URL northURL = AssetUtils.getAssetURL(northURI);
            final URL southURL = AssetUtils.getAssetURL(southURI);
            final URL eastURL = AssetUtils.getAssetURL(eastURI);
            final URL westURL = AssetUtils.getAssetURL(westURI);
            final URL downURL = AssetUtils.getAssetURL(downURI);
            final URL upURL = AssetUtils.getAssetURL(upURI);
           
            LOGGER.fine("URLs acquired. Building textures.");
            Texture north = TextureManager.loadTexture(northURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture south = TextureManager.loadTexture(southURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture east = TextureManager.loadTexture(eastURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture west = TextureManager.loadTexture(westURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture up = TextureManager.loadTexture(upURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture down = TextureManager.loadTexture(downURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);                       
        
            LOGGER.fine("Textures built. Setting fields.");
            skybox.setTexture(Skybox.Face.North, north);
            skybox.setTexture(Skybox.Face.West, west);
            skybox.setTexture(Skybox.Face.South, south);
            skybox.setTexture(Skybox.Face.East, east);
            skybox.setTexture(Skybox.Face.Up, up);
            skybox.setTexture(Skybox.Face.Down, down);

            LOGGER.fine("Fields set. Skybox finished.");

        } catch (MalformedURLException ex) {
            Logger.getLogger(SkyboxEditor.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

       
    }
   
    public void update() {
        if (isActiveSkybox()) {
            final Skybox skybox = buildSkybox();
            final DefaultEnvironmentRenderer renderer =
                            skyboxProperties.getDefaultEnvironmentRenderer();

            SceneWorker.addWorker(new WorkCommit() {
View Full Code Here

            });
        }
    }

    private Skybox buildSkybox() {
        Skybox skybox = new Skybox("skybox", 1000, 1000, 1000);
        try {
           
            LOGGER.fine("Acquiring URLs");
            final URL northURL = AssetUtils.getAssetURL(northURI);
            final URL southURL = AssetUtils.getAssetURL(southURI);
            final URL eastURL = AssetUtils.getAssetURL(eastURI);
            final URL westURL = AssetUtils.getAssetURL(westURI);
            final URL downURL = AssetUtils.getAssetURL(downURI);
            final URL upURL = AssetUtils.getAssetURL(upURI);
           
            LOGGER.fine("URLs acquired. Building textures.");
            Texture north = TextureManager.loadTexture(northURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture south = TextureManager.loadTexture(southURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture east = TextureManager.loadTexture(eastURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture west = TextureManager.loadTexture(westURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture up = TextureManager.loadTexture(upURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture down = TextureManager.loadTexture(downURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);                       
        
            LOGGER.fine("Textures built. Setting fields.");
            skybox.setTexture(Skybox.Face.North, north);
            skybox.setTexture(Skybox.Face.West, west);
            skybox.setTexture(Skybox.Face.South, south);
            skybox.setTexture(Skybox.Face.East, east);
            skybox.setTexture(Skybox.Face.Up, up);
            skybox.setTexture(Skybox.Face.Down, down);

            LOGGER.fine("Fields set. Skybox finished.");

        } catch (MalformedURLException ex) {
            Logger.getLogger(SkyboxEditor.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

    fogState.setApplyFunction( FogState.AF_PER_VERTEX );
    rootNode.setRenderState( fogState );
  }

  private void buildSkyBox() {
    skybox = new Skybox( "skybox", 10, 10, 10 );

    String dir = "jmetest/data/skybox1/";
    Texture north = TextureManager.loadTexture(
        TestQuadWater.class.getClassLoader().getResource(
            dir + "1.jpg" ),
View Full Code Here

    fogState.setApplyFunction( FogState.AF_PER_VERTEX );
    rootNode.setRenderState( fogState );
  }

  private void buildSkyBox() {
    skybox = new Skybox( "skybox", 10, 10, 10 );

    String dir = "jmetest/data/skybox1/";
    Texture north = TextureManager.loadTexture(
        TestSimpleQuadWater.class.getClassLoader().getResource(
            dir + "1.jpg" ),
View Full Code Here

            URL westURL = AssetUtils.getAssetURL("wla://defaultenvironment/skybox1/4.jpg", cell);
            URL downURL = AssetUtils.getAssetURL("wla://defaultenvironment/skybox1/5.jpg", cell);
            URL upURL = AssetUtils.getAssetURL("wla://defaultenvironment/skybox1/6.jpg", cell);

            WorldManager wm = ClientContextJME.getWorldManager();
            skybox = new Skybox("skybox", 1000, 1000, 1000);
            Texture north = TextureManager.loadTexture(northURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture south = TextureManager.loadTexture(southURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture east = TextureManager.loadTexture(eastURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture west = TextureManager.loadTexture(westURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture up = TextureManager.loadTexture(upURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
View Full Code Here

      rootNode.attachChild(posBox);
      fpsNode.attachChild(tankHUD);
      fpsNode.attachChild(hitStatus);
     
    /** Create a skybox to suround our world */
    Skybox sb = new Skybox("skybox", 500, 500, 500);
    URL monkeyLoc = HelloIntersection.class.getClassLoader().getResource(
        "data/texture/sky4stars-a_original.jpg");
    TextureState ts = display.getRenderer().createTextureState();
    ts.setTexture(TextureManager.loadTexture(monkeyLoc, Texture.MM_LINEAR,
        Texture.FM_LINEAR));
    sb.setRenderState(ts);

    // Attach the skybox to our root node, and force the rootnode to show
    // so that the skybox will always show
    rootNode.attachChild(sb);
    rootNode.setCullMode(Spatial.CULL_NEVER);
View Full Code Here

      getRootNode().attachChild(posBox);
      getFPSNode().attachChild(tankHUD);
        getFPSNode().attachChild(hitStatus);
     
    /** Create a skybox to suround our world */
    Skybox sb = new Skybox("skybox", 500, 500, 500);
    URL monkeyLoc = TankApplet.class.getClassLoader().getResource(
        "data/texture/sky4stars-a_original.jpg");
    TextureState ts = getRenderer().createTextureState();
    ts.setTexture(TextureManager.loadTexture(monkeyLoc, Texture.MM_LINEAR,
        Texture.FM_LINEAR));
    sb.setRenderState(ts);

    // Attach the skybox to our root node, and force the getRootNode() to show
    // so that the skybox will always show
    getRootNode().attachChild(sb);
    getRootNode().setCullMode(Spatial.CULL_NEVER);
View Full Code Here

TOP

Related Classes of com.jme.scene.Skybox

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.