Giter VIP home page Giter VIP logo

Comments (8)

MasDennis avatar MasDennis commented on June 7, 2024

Could give it a test run? Thanks

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on June 7, 2024

Great, the mipmapping works now! :)

I think I misreported the object disappearance, its quite hard to understand exactly what happens so I made 2 videos showing some odd behaviour and uploaded the example project the videos shows.

Video #1 shows a live wallpaper with 2 obj imported objects, one a clone of the other, when the opengl context is recreated we see both objects.
http://www.youtube.com/watch?v=dX1eYUhFhMA

Video #2 is the same scene but I load another obj object (which is not shown) before loading the object that gets cloned. Now when recreating the opengl context the cloned object disappears.
http://www.youtube.com/watch?v=eHBbnX5y0e8&feature=youtu.be

The project from the videos can be found here: http://www.2shared.com/file/3SgnI5xy/CloneTest.html
Its a very small project with 2 source files and an obj file.

from rajawali.

MasDennis avatar MasDennis commented on June 7, 2024

Thanks for the elaborate error report :-) Please try the latest fix.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on June 7, 2024

Thanks! Appears to work now, wish I could have fixed it myself instead of being a bother but I had no idea what I was doing :)

Closing issue.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on June 7, 2024

Hm, I found a strange behavior here. It appears that clones have a separate position but they share the scale with the original copy. That is, if you change the scale of the copy then the original scales as well. Is this a bug?

Edit - I submitted a fix for this.

from rajawali.

ChristofferGreen avatar ChristofferGreen commented on June 7, 2024

I have found another way in which the disappearing object bug via clone happens, if you load an obj file (but do not add the obj file via addChild) and then clone it and then do addChild with it then at first the clone will be visible but after opengl reload it will dissappear.

So, in my previous code example this code will produce the bug: (notice the commented out addChild on the object)

    // When this code is commented this is what happens: http://www.youtube.com/watch?v=dX1eYUhFhMA
    // When it is uncommented this happens: http://www.youtube.com/watch?v=eHBbnX5y0e8&feature=youtu.be
    //Uncomment the following 3 lines to get a bug where the cloned object (object 2 below) disappears when recreating the opengl context
    ObjParser parser2 = new ObjParser(this.getContext().getResources(), this.getTextureManager(), R.raw.turn_right);
    parser2.parse();
    BaseObject3D objectNotUsed = parser2.getParsedObject();

    ObjParser parser = new ObjParser(this.getContext().getResources(), this.getTextureManager(), R.raw.turn_right);
    parser.parse();
    AMaterial mat = new SimpleMaterial();
    mat.setUseColor(true);
    BaseObject3D object = parser.getParsedObject();
    object.setMaterial(mat);
    object.setZ(5.0f);
    object.setDoubleSided(true);
    object.setColor(0xff0000);
    //addChild(object);
    BaseObject3D object2 = object.clone();
    object2.setMaterial(mat);
    object2.setX(-1.0f);
    object2.setZ(5.0f);
    object2.setScaleY(-1.0f);
    object2.setDoubleSided(true);
    object2.setColor(0x00ff00);
    addChild(object2);      

from rajawali.

MasDennis avatar MasDennis commented on June 7, 2024

Ah yeah, so it only reloads the resources when it's added to the scene because it iterates through the display list.
You could addChild() and then setVisible(false).

from rajawali.

MasDennis avatar MasDennis commented on June 7, 2024

Oh sorry, I see what you mean. I'll investigate.

from rajawali.

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.