Schlagwörter: jmonkey Kommentarverlauf ein-/ausschalten | Tastaturkürzel

  • Andreas Höhmann 0:10 am Monday, 23. January 2012 Permalink |
    Tags: , github, jmonkey   

    jmonkey maven support next round 

    jmonkey have no maven support … here is my solution 🙂

    1. clone jme3-thirdparty from git, mvn install … done
    2. clone jme3-buildhelper, copy pom.xml into jmonkey-engine … done
    3. start hacking your jmonkey game with maven build support 🙂

    https://github.com/ahoehma/jme3-maven-helper

    Advertisements
     
  • Andreas Höhmann 1:24 am Saturday, 13. August 2011 Permalink |
    Tags: , jmonkey, perlin noise, tessellation   

    Bloxel Perlin Volume Renderer 

    We are making progress 😀

    I implemented a tessellation algorithm for volume -> mesh creation … here are some pictures from the bloxel labs …

     
  • Andreas Höhmann 0:38 am Wednesday, 2. March 2011 Permalink |
    Tags: jmonkey, mesh, multitexture   

    MultiFaceBox mesh for bloxel 

    News from bloxel …

    Last days I spend a couple of hours creating a box mesh for our game bloxel which have different textures for each side … like this one …

    … without success … until now *g*

    First of all jmonkey rocks … but the multi texture support is not easy to use/understand for a rookie like me.

    Here the thinks I checked out:

    • http://jmonkeyengine.org/groups/general-2/forum/topic/box-with-multiple-textures/
      • the idea here was to create a box in a editor, and generate mapping coordinates for it, then  import it into JME with the ogre xml importer
      • paddy (bloxel team member) tried this approach with blender, the result was an .obj file with two geometries inside a) the grass geo on top and b) the dirt geos on the other sides
      • long story short end … this doesn’t work very well
    • then I tried the jme3 sky material
      • this material use a TextureCubeMap (multiple images for cube sides)
      • not working for me … sky material is only for sky-boxes I guess
    • then I want use shaders (glsl) to get the different textures on the box
      • but my knowledge about glsl is near zero *gg* … so I tried to find shader-code with google … no success
    • then I found the jme2 class MultiFaceBox
      • ported to jme3 was quite simple
      • play a little bit with the right texture
      • and voilà … here we are
    
    public class MultiFaceBox extends Box {
    
      public MultiFaceBox() {
        super();
        remap();
      }
    
      public MultiFaceBox(final Vector3f center, final float xExtent, final float yExtent, final float zExtent) {
        super(center, xExtent, yExtent, zExtent);
        remap();
      }
    
      public MultiFaceBox(final Vector3f min, final Vector3f max) {
        super(min, max);
        remap();
      }
    
      private void remap() {
        final FloatBuffer fb = getFloatBuffer(Type.TexCoord);
        fb.rewind();
        for (int i = 0; i < 6; i++) {
          final float top = i / 8f;
          final float bottom = (i + 1) / 8f;
          final float[] tex = new float[] { 1, bottom, 0, bottom, 0, top, 1, top };
          fb.put(tex);
        }
      }
    }
    
    

    This works for me … now I can remove the unused two empty areas in the texture …

     
  • Andreas Höhmann 22:05 am Saturday, 19. February 2011 Permalink |
    Tags: , heightmap, jmonkey   

    Heightmap based terrain loading for bloxel 

    Last night I finished the first prototype of a heightmap based TerrainLoader.

    • I’m using a com.jme3.terrain.heightmap.HillHeightMap to create a 512×512 2D heightmap
    • our 3D TerrainChunkLoader (our manager for infinite worlds) map a TerrainChunk (x,y,z) to a region of this 2D map
    • here I had some problems to transform the 512×512 heightmap (2D) to the 4×4 terrain-chunks (3D) … but now it works 🙂

     

     

     

    Update 20.02.2011 – better textures for grass and dirt

     
  • Andreas Höhmann 3:26 am Tuesday, 15. February 2011 Permalink |
    Tags: , jmonkey   

    Bloxel 0.2.0 with better performance 

    To handle scenes with many elements you have to „merge“ identical objects (Geometry’s) … I did it for bloxel 0.2.0 and the performance is now much better … here are two brand new screenshots :

     

    JMonkey contains a class for that :  jme3tools.optimize.GeometryBatchFactory. This forum entry shows me the way : http://jmonkeyengine.org/groups/general/forum/topic/how-to-useoptimize-pvs-or-octree

    FYI: our main application loop contains a „updateTerrain“ method:

    // near elements ... player can add/remove such elements ...
    final TerrainElementsResult result = terrainManager.getTerrainElements(thePlayerPosition, theWalkDirection);
    final Set<TerrainElement> currentElements = Sets.newLinkedHashSet(currentTerrainElements);
    final Set<TerrainElement> elementsToAdd = Sets.difference(new HashSet(result.getNearElements()), currentElements);
    final Set<TerrainElement> elementsToRemove = Sets.difference(currentTe, new HashSet(result.getNearElements()));
    // ... add new elements to scene, physics, cache etc ...
    // ... remove old elements from scene, physics, cache etc ...
    
    // far elements
    final Iterator<TerrainElement> iterator = result.getFarElements().iterator();
    final List<Geometry> geos = Lists.newArrayList();
    while (iterator.hasNext()) {
      final TerrainElement te = iterator.next();
      Bloxel bloxel = bloxelCache.getFromCache(te.getCenter());
      if (bloxel == null) {
        bloxel = bloxelFactory.create(te.getBloxelType());
        bloxel.setLocalTranslation(te.getCenter());
      }
      geos.add(bloxel);
    }
    final List<Geometry> makeBatches = GeometryBatchFactory.makeBatches(geos);
    bloxelsFarNode.detachAllChildren();
    final Material material = new Material(assetManager, "Common/MatDefs/Misc/WireColor.j3md");
    material.setColor("Color", ColorRGBA.White);
    for (final Geometry geometry : makeBatches) {
      // for debugging
      // geometry.setMaterial(material);
      bloxelsFarNode.attachChild(geometry);
    }
    System.out.println("update far terrain time: " + (System.currentTimeMillis() - start));
    

    Good night 😉

     
  • Andreas Höhmann 13:16 am Thursday, 10. February 2011 Permalink |
    Tags: , jmonkey, opengl   

    Bloxel 0.1.0 

    I’m working on a new hobby project called BLOXEL – Yet another Minecraft clone 😉

    We try to implement a infinit open world with the  JMonkey 3D Game engine – all in Java!

    Here is the first screenshot

     

    Pictures of a brand new glass bloxel with a nice transparency effect

     
c
Neuen Beitrag erstellen
j
nächster Beitrag/nächster Kommentar
k
vorheriger Beitrag/vorheriger Kommentar
r
Antworten
e
Bearbeiten
o
zeige/verstecke Kommentare
t
Zum Anfang gehen
l
zum Login
h
Zeige/Verberge Hilfe
Shift + ESC
Abbrechen