GithubHelp home page GithubHelp logo

Comments (7)

NickHardeman avatar NickHardeman commented on August 10, 2024

The stanford bunny doesn't have any texture coords since the model was created via scanning. You could bring it into Blender and try some of the texturing tools.

from ofxbullet.

stephanschulz avatar stephanschulz commented on August 10, 2024

ok. thx.

what about the penguin in the OF sample 3DModelLoaderExample.

I used the penguin.ply and the penguin.jpg
loaded both in and use

in setup

    texture.load("penguin.jpg");
    texture.getTexture().setTextureWrap( GL_REPEAT, GL_REPEAT );
    mesh.load("penguin.ply");


in draw

     texture.getTexture().bind();
     bunnies[i]->draw();
     texture.getTexture().unbind();

but a model never appears, and the app starts hanging when pressing key == 'b'

???

from ofxbullet.

NickHardeman avatar NickHardeman commented on August 10, 2024

A lot of 3D models use 0 -> 1 texture coordinates. So try calling

ofDisableArbTex();
texture.load("penguin.jpg");
ofEnableArbTex();

And after the mesh.load call, print out the number of tex coords on the mesh to make sure it has texture information.

from ofxbullet.

stephanschulz avatar stephanschulz commented on August 10, 2024

Thanks.

Still no luck. Maybe you can take a look?
I put together my OF 0.10 copy of your example.

https://www.dropbox.com/s/tsfwj4pxa45l6gu/SoftBodyMeshExample.zip?dl=0

    ofDisableArbTex();
    texture.load("penguin.jpg");
    ofEnableArbTex();

    mesh.load("penguin.ply");
    ofLog()<<"mesh.getNumTexCoords() "<<mesh.getNumTexCoords();
    ofLog()<<"mesh.getNumIndice() "<<mesh.getNumIndices();
[notice ] mesh.getNumTexCoords() 11486
[notice ] mesh.getNumIndice() 21348

from ofxbullet.

NickHardeman avatar NickHardeman commented on August 10, 2024

from ofxbullet.

stephanschulz avatar stephanschulz commented on August 10, 2024

Thanks again.

I went ahead and made a OF 0.9.8 project.
https://www.dropbox.com/s/mky2g7ykeflfjvc/SoftBodyMeshExample_0-9-8.zip?dl=0

You are right that the penguin has 4 times more vertices.
So I tried the squirrel. It's hard to tell if it texture maps ok, since it is super small in the app.

I guess I will have to find a ok sized model + it's texture.
Does the texture need to have a specific size, or would any image work?

in OF 0.9.8

[notice ] mesh_bunny.getNumTexCoords() 0
[notice ] mesh_bunny.getNumIndice() 5388
[notice ] mesh_penguin.getNumTexCoords() 0
[notice ] mesh_penguin.getNumIndice() 21348
[notice ] mesh_squirrel.getNumTexCoords() 402
[notice ] mesh_squirrel.getNumIndice() 1701

in OF 0.10

[notice ] mesh_bunny.getNumTexCoords() 0
[notice ] mesh_bunny.getNumIndice() 5388
[notice ] mesh_penguin.getNumTexCoords() 11486
[notice ] mesh_penguin.getNumIndice() 21348
[notice ] mesh_squirrel.getNumTexCoords() 402
[notice ] mesh_squirrel.getNumIndice() 1701

from ofxbullet.

NickHardeman avatar NickHardeman commented on August 10, 2024

from ofxbullet.

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.