Giter Site home page Giter Site logo

Comments (5)

tapio avatar tapio commented on September 28, 2024

Try setting smaller gravity, to see if the going through is because of too high velocity, though I it's kind of a long shot.

Also, __dirty* flags are needed only if you set position/rotation after adding to the scene, so unnecessary here.

But after reading the Wiki section "Why can't I scale objects?" I scaled the object in Blender and exported it so I could remove the scale.set line -- (It does make working with the objects in Blender a bit of a pain, if there is a different approach that you know of, that would be great.)

In latest version of Physijs, scale should be honored when adding the object to the scene (but not afterwards). You can also use the Blender exporter's Scale option which will leave the .blend intact but scale the exported object. Third option is to manually fiddle with the "scale": 1.00000 line in the exported model .js file.

from physijs.

bberryhill avatar bberryhill commented on September 28, 2024

Thanks much tapio for the insight on __dirty* flags and scaling. I'll definitely but that info to use.

I tried changing the y gravity from -60 to -5 and the z from 10 to 0. The ball is still passing through the Blender object and hitting the ground.

With the other ball hitting something that isn't visible when it should fall directly to the ground, it seems that the physics object for the Blender object is in a different position than the blue visible Blender object.

Does that seem like a possibility? Any ideas how I should get the non-visible physics to line up with the visible Blender object?

from physijs.

tapio avatar tapio commented on September 28, 2024

It seems to me that your object is not centered. For physics objects, it's usually a good idea to have the center of mass of the object be at (0, 0, 0), to make rotation behave as expected (actually any object that is going to be rotated should probably be centered around at least some of the axes). There is an align option in the Blender exporter to do that for you automatically. Try that.

from physijs.

bberryhill avatar bberryhill commented on September 28, 2024

Thanks much tapio. Using the align option in the Blender exporter looks to have worked. I've uploaded the fix to my previous link.

Thanks for your time. Much appreciated.

from physijs.

chandlerprall avatar chandlerprall commented on September 28, 2024

Thanks @tapio

Wiki has been updated to reflect the recent changes.

from physijs.

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.