Recent Posts

Pages: [1] 2 3 ... 10
1
Support / Re: texture not shown
« Last post by Sethe on 03. January 2017, 07:35:05 AM »
be a great idea to start the environment and loop, not static, and multi-threading available

First I recommend you to read http://xith.org/downloads/docs/xin/xin-3rd-edition.pdf.

That link is dead I think.
2
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by jomaveger on 06. October 2016, 11:03:30 AM »
Hello!

I've uploaded the project to Google Drive. It's a maven project and it uses the compiled trunks of the xith and jagatoo projects, which I have in my maven local repository as versions 0.9.8 and 1.1.2, respectively. The link is https://drive.google.com/file/d/0B-PfhOCCFsFXWFdMUFpPMkpsSGM/view?usp=sharing

Please, tell me if you have any problem downloading it.

Thanks for all.

Kind regards,

Joseph
3
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by lonesomeStranger on 05. October 2016, 07:49:29 PM »
Jomaveger could you please send me some of your code/assets?

First, I've reproduced your bug (wrong  skin name) but after that I've broke the build,  (I dunno how ...) and I'd have attempted to  revive it during the half of the day, but I decided to stop this crappy work.

In short, I'd like to build a fragment of your application to finish debugging.
4
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by jomaveger on 04. October 2016, 11:10:11 AM »
Oh, good news! It's great! Thanks a lot! I'll be waiting anxiously  ;D

Kind regards, lonesomeStranger

Joseph
5
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by lonesomeStranger on 03. October 2016, 07:50:34 PM »
Hi,

Thank you for your patience, jomaveger.

I'll try to fix issue until the weekend.

Looks like the problem is trifling.

I hope it's the single bug :) .
6
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by jomaveger on 28. September 2016, 11:43:15 AM »
Hello!

Are there any news about this issue? Thanks in advance.

Best regards,

Joseph
7
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by jomaveger on 07. September 2016, 10:52:53 AM »
Hi lonesomeStranger:

Thank you very much. Don't worry if you take some time to fix the issue. I understand that you're busy.

I'll follow your advice and stay with the SVN-trunk version of Xith3d.

Thanks a lot again and in advance.

Kind regards,

Joseph
8
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by lonesomeStranger on 06. September 2016, 02:23:49 PM »
Hi jomaveger,

I'm very sorry that can't help you quickly and completely. I'm very busy by now.

Nevertheless I'd suggest you stay with the SVN-trunk version of XIth3d. 'xith3D-0.9.8' is quite ancient and buggy.

I'll try to fix the issue ASAP.

Btw Frankly, looks like I stay alone at the Xith3d. So, I'm not sure that it won't be discontinued.
9
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by jomaveger on 05. September 2016, 11:46:32 AM »
Hello again!

I solved the problem returning to Xith3D version v0.9.7-dev-B1831. At least, I can load and see one of the Quake 3 maps that comes with the Xith3D demos. I add some models with their skins to the map and it works fine.

But I'm working on collision and I've found a problem. I don't want to walk through the MD2 characters/models, the same I don't walk through the walls of the map. For every MD2 model, I've created a Collideable and added to the CollideableGroup of the ClusterManager and nothing happens. It's very strange. My code is the following:

Code: [Select]
public class BSPManager extends Window {
   
    private final static Logger logger = Logger.getLogger(BSPManager.class);
   
    private PhysicsEngine physEngine;
    private CollisionEngine collEngine;
    private CollisionEnabledClusterManager clusterManager;
    private BranchGroup scene;
    private FirstPersonInputHandler firstPersonHandler;
    private final String levelName;
    private Level level;
    private CollideableGroup levelGroup;
    private Model bspScene;
    private final List<Enemy> enemy;
    private final Random generator;
   
   
    public BSPManager(Engine loop, int width, int height, String title, boolean isFullScreen, String level) {
        super(loop, width, height, title, isFullScreen);
        this.levelName = level;
        this.enemy = new ArrayList<>();
        this.generator = new Random();
    }
   
    public void loadLevelData() {
        LevelReader levelReader = new LevelReader(levelName);
        level = levelReader.buildMap();
    }

    public void buildScene() {
        try {
            setPhysicsAndCollisionEngine();
            setBSPMap();
            if (bspScene.getSpawnTransformsCount() > 0) {
                for (int i = 0; i < bspScene.getSpawnTransformsCount(); i++) {
                    int j = generator.nextInt(level.getEnemyList().size());
                    addEnemyInsideTheMap(level.getEnemyList().get(j), bspScene.getSpawnTransform(i), i);                   
                }
            }
            configureBSPMap();
            setFirstPersonHandler();
        } catch (Exception ex) {
            logger.error("Exception building the scene!", ex);
        }
    }

    private void setPhysicsAndCollisionEngine() {
        physEngine = new JoodePhysicsEngine();
environment.setPhysicsEngine(physEngine);
collEngine = physEngine.getCollisionEngine();
        collEngine.setEnabled(true);
    }

    private void setBSPMap() throws IOException {
        this.bspScene = ModelLoader.getInstance().loadModel(ResourcesLoader.getResourceLocator().getResource(level.getMapName()));
       
        if (bspScene.getMainGroup() instanceof BSPTreeGroup) {
            BSPTreeGroup bspTG = (BSPTreeGroup) bspScene.getMainGroup();
            this.clusterManager = new CollisionEnabledClusterManager((BSPClusterManager) bspTG.getBSPVisibilityUpdater(), bspScene, collEngine);
            bspTG.setBSPVisibilityUpdater(clusterManager);
            this.clusterManager.setPVSUsage(false);
            if (this.clusterManager != null) {
                this.levelGroup = this.clusterManager.getCollideableGroup();
            } else {
                this.levelGroup = null;
            }
        }
    }

    private void addEnemyInsideTheMap(Enemy e, Matrix4f matrix, int spawnLocationIndex) throws IOException {
        Model enemyModel = ModelLoader.getInstance().loadModel(ResourcesLoader.getResourceLocator().getResource(e.getModelURL()), e.getModelSkin(), 0.1F);
       
        enemyModel.addAnimationListener(new EnemyListener(enemyModel));
        enemyModel.setUserData(e);
        enemyModel.setCurrentAnimation("stand");
        e.setModel(enemyModel);
        Transform t = new Transform();
        t.addChild(enemyModel);
        t.setMatrix(matrix);
        if (spawnLocationIndex == 2) {
            t.addTranslation(5.0F, 2.0F, 5.0F);
            t.updateTransform();
        }
        t.addChild(new AmbientLight(Colorf.WHITE));
        e.setTg(t);
        this.enemy.add(e);
        this.bspScene.addChild(t);
    }

    private void configureBSPMap() {
        if (bspScene.getSpawnTransformsCount() > 0) {
            environment.getView().getTransform().set(bspScene.getSpawnTransform(2));
        }

        if (bspScene.getSkyBox() != null) {
            environment.addRenderPass(bspScene.getSkyBox());
        }
        this.scene = new BranchGroup(this.bspScene);
        RenderPass renderPass = environment.addPerspectiveBranch(this.scene);
        renderPass.getConfig().setFrontClipDistance(0.5f);
        renderPass.getConfig().setBackClipDistance(6000.0f);
        renderPass.setClipperEnabled(false);
        renderPass.getConfig().setOpaqueSortingPolicy(org.xith3d.render.Renderer.OpaqueSortingPolicy.SORT_NONE);
    }
   
    private void setFirstPersonHandler() {
        for (Enemy e : enemy) {
            CollideableGroup newTriMesh = collEngine.newTriMeshGroup(e.getModel());
            this.clusterManager.getCollideableGroup().addCollideable(newTriMesh);
            physEngine.getGFXManager().add(newTriMesh, e.getTg());
        }
       
        boolean mouseYInverted = false;
        firstPersonHandler = new FirstPersonInputHandler(environment.getView(), canvas, 1.0f, 1.0f, mouseYInverted, 1.0f);
        firstPersonHandler.getMovementConstraints().setFixedPlaneEnabled(true);
        firstPersonHandler.getBindingsManager().createDefaultBindings();
        firstPersonHandler.getBindingsManager().unbind(FPIHInputAction.CROUCH);
        InputSystem.getInstance().addInputHandler(firstPersonHandler);

        SimulationWorld world = physEngine.getSimulationEngine().newWorld();
        world.setGravity(0f, -9.81f, 0f);
        firstPersonHandler.setPhysicsObject(new FPIHPhysics(1.5f, 3.0f, new Vector3f(0f, -1.1f, 0f), physEngine, world, true, false));
       
        if (!collEngine.isEnabled()) {
            collEngine.setEnabled(true);
        }
        firstPersonHandler.getPhysicsObject().setCollisionsEnabled(true);
        firstPersonHandler.getPhysicsObject().setSlidingColliderCheckCallback(physEngine.getCollisionEngine(), this.clusterManager.getCollideableGroup());
       
    }
}


Thanks in advance,
Best regards,

Joseph
10
Support / Re: Problem with some textures loading Quake 3 bsp levels
« Last post by jomaveger on 04. September 2016, 05:07:49 PM »
Hello lonesomeStranger:

Thank you for the idea. But I've run into new problems.

I've downloaded the SVN-trunk at sourceforge and build it. Now I use that distribution of Xith3D with Maven and I call it xith3D-0.9.8. I had a problem with:

Canvas3DFactory.createWindowed(...)

After investigating, I downloaded the SVN-trunk at sourceforge of the jagatoo project and build it. With this new compilation, there is no problem creating a window.

Before I use the new Xith3D and Jagatoo versions, I could load a Quake 3 map and some MD2 models in it with their skins, but now I cannot. Well, there is a map, there are the models but not their skins.

This is my line of code:

Model enemyModel = ModelLoader.getInstance().loadModel(ResourcesLoader.getResourceLocator().getResource(e.getModelURL()), e.getModelSkin(), 0.1F);

where e is of class Enemy with the properties read from an XML file and the fact is "e.getModelSkin()" returns "usmc.pcx" and "e.getModelURL()" returns "models/marine/tris.md2". Well, the exception is:

java.lang.IndexOutOfBoundsException
   at java.io.BufferedInputStream.read(BufferedInputStream.java:327)
   at org.jagatoo.util.streams.StreamUtils.buildByteArray(StreamUtils.java:550)
   at org.jagatoo.util.streams.StreamUtils.buildByteArray(StreamUtils.java:589)
   at org.jagatoo.loaders.textures.formats.TextureImageFormatLoaderPCX.loadTextureImage(TextureImageFormatLoaderPCX.java:243)
   at org.jagatoo.loaders.textures.AbstractTextureLoader.tryToLoadFromTextureImageFormatLoaders(AbstractTextureLoader.java:347)
   at org.jagatoo.loaders.textures.AbstractTextureLoader.loadTextureFromStream(AbstractTextureLoader.java:526)
   at org.jagatoo.loaders.textures.AbstractTextureLoader.loadTextureFromURL(AbstractTextureLoader.java:841)
   at org.xith3d.loaders.texture.TextureLoader.loadTexture(TextureLoader.java:448)
   at org.xith3d.loaders.models.conversion.XithAppearanceFactory.loadTexture(XithAppearanceFactory.java:717)
   at org.xith3d.loaders.models.conversion.XithAppearanceFactory.loadOrGetTexture(XithAppearanceFactory.java:748)
   at org.jagatoo.loaders.models.md2.MD2File.loadTexture(MD2File.java:133)
   at org.jagatoo.loaders.models.md2.MD2File.createSkin(MD2File.java:159)
   at org.jagatoo.loaders.models.md2.MD2File.readSkins(MD2File.java:182)
   at org.jagatoo.loaders.models.md2.MD2File.<init>(MD2File.java:639)
   at org.jagatoo.loaders.models.md2.MD2File.load(MD2File.java:661)
   at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:550)
   at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:617)
   at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:649)
   at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:754)
   at org.jomaveger.tigergameengine3d.game.core.BSPManager.addEnemyInsideTheMap(BSPManager.java:113)


What happens is that, inside the method org.jagatoo.loaders.models.md2.MD2File.readSkins, jagatoo tries to read the skinName with the instruction:

String skinName = fixPath( in.readCString( 64, true ) );

Well, it returns "ne/usmc.pcx" where it should be "usmc.pcx". I've been debugging jagatoo code but I don't know how to fix it.

Thanks in advance,
best regards,

Joseph 
Pages: [1] 2 3 ... 10