Coder Social home page Coder Social logo

Comments (9)

mgsx-dev avatar mgsx-dev commented on August 15, 2024 2

@waverider404 maybe you didn't configure num bones properly, see #6
BTW, it would be nice to create another issue next time. Since it may be not related to unsigned short indices.

from gdx-gltf.

mgsx-dev avatar mgsx-dev commented on August 15, 2024 1

indeed, model cache is not compatible with more than 32k vertices for now. I'm working on a libgdx PR : libgdx/libgdx#5925 which will fix it once merged.

For now, you should either keep max 32k vertices or don't use model cache.

I could add a compatible mesh cache in this repository if my PR get rejected or delayed, so we can let this issue opened until then.

from gdx-gltf.

mgsx-dev avatar mgsx-dev commented on August 15, 2024

Unsigned short indices are supported but still experimental

This message is just a warning.

I'm able to load your file with the demo/viewer :
Screenshot 2020-03-25 00:19:13

@waverider404 Could you please give more information: What's your issue precisely? any stacktrace or relevent error message? which platform? which gdx-gltf version?

from gdx-gltf.

ademola-lou avatar ademola-lou commented on August 15, 2024

Sorry I just received the message, I am using the gltf-master-SNAPSHOT

from gdx-gltf.

ademola-lou avatar ademola-lou commented on August 15, 2024

Exception in thread "LWJGL Application" java.lang.ArrayIndexOutOfBoundsException
at com.badlogic.gdx.utils.FloatArray.addAll(FloatArray.java:126)
at com.badlogic.gdx.graphics.g3d.utils.MeshBuilder.addVertex(MeshBuilder.java:503)
at com.badlogic.gdx.graphics.g3d.utils.MeshBuilder.addMesh(MeshBuilder.java:775)
at com.badlogic.gdx.graphics.g3d.utils.MeshBuilder.addMesh(MeshBuilder.java:755)
at com.badlogic.gdx.graphics.g3d.ModelCache.end(ModelCache.java:299)
at com.mygdx.game.MyGdxGame.create(MyGdxGame.java:113)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:151)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:128)

from gdx-gltf.

ademola-lou avatar ademola-lou commented on August 15, 2024

Here is my code
`

@Override
public void create() {

	Bullet.init();
	btCollisionObject groundObject = new btCollisionObject();

	CharSequence str = groundObject.toString();
	System.out.println(str);

	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
	environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

	modelBatch = new ModelBatch();

	cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	cam.position.set(10f, 10f, 10f);
	cam.lookAt(0,0,0);
	cam.near = 1f;
	cam.far = 300f;
	cam.update();

	SceneAsset model_asset = new GLBLoader().load(Gdx.files.internal("grass.glb"));
 	double range = 80;
	int count = 300*10;

	for (int index = 0; index < count; index++) {
		double x = (range / 2) - (Math.random() * range);
		double z = (range / 2) - (Math.random() * range);
		this.instance = new ModelInstance(model_asset.scene);
		this.instance.transform.setTranslation((float) x, 1.0f, (float) z);
		this.instance.transform.scale(8.5f, 8.5f, 8.5f);
		this.trees.add(this.instance);
	}
	

	Texture texture = new Texture(Gdx.files.internal("badlogic.jpg"));


	SceneAsset room_asset = new GLBLoader().load(Gdx.files.internal("room.glb"));

	
	 ModelBuilder modelBuilder = new ModelBuilder();
        model = modelBuilder.createBox(5f, 5f, 5f, 
            new Material(TextureAttribute.createDiffuse(texture)),
            Usage.Position | Usage.Normal | Usage.TextureCoordinates);
        ModelInstance boxInstance = new ModelInstance(room_asset.scene);
        
        this.trees.add(boxInstance);
	
	treeCache = new ModelCache();
	treeCache.begin();
	treeCache.add(trees);
	treeCache.end();

	camController = new CameraInputController(cam);
	Gdx.input.setInputProcessor(camController);
}

`

from gdx-gltf.

ademola-lou avatar ademola-lou commented on August 15, 2024

that will be awesome!!

from gdx-gltf.

ademola-lou avatar ademola-lou commented on August 15, 2024

Skinned model looks distorted when I animate them :(
model file : https://cdn.glitch.com/ca440387-5ef4-4401-a707-6a988d4e8bc5%2Fcynthia.glb?v=1585537867699

Screen Shot 2020-03-29 at 11 08 16 PM

from gdx-gltf.

mgsx-dev avatar mgsx-dev commented on August 15, 2024

libgdx/libgdx#5925 has been merged, it's now possible to use ModelCache with libgdx 1.9.11-SNAPSHOT.

from gdx-gltf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.