简体   繁体   中英

Rajawali get object center of gravity point

Using Rajawali library i loaded object from obj file

LoaderOBJ objParser = new LoaderOBJ(mContext.getResources(),
            mTextureManager, R.raw.fridge_obj);
    loadModel(objParser, new IAsyncLoaderCallback() {

    @Override
    public void onModelLoadComplete(ALoader loader) {
        Log.d(TAG, "Model load complete: " + loader);
        final LoaderOBJ obj = (LoaderOBJ) loader;
        mObjectGroup = obj.getParsedObject();
        getCurrentScene().addChild(mObjectGroup);
    }

    @Override
    public void onModelLoadFailed(ALoader loader) {
        Log.e(TAG, "Model load failed: " + loader);
    }
}, R.raw.fridge_obj);

now i want get object center of gravity point to set it on world zero point and rotate over that point. I try to get data from Geometry3D how ever i BoundingBox is null same as Vertices field.

How can i get object center of gravity without change object file?

Rajawali currently includes no method for calculating the centroid of an object. If you create a well formatted and worded issue on the github page, we can mark it as a feature request and work on adding it as it would be a useful addition.

您可以将.obj加载到Blender中,并使用CTRL + ALT + SHIFT + C更改轴。然后Rajawali将使用新的轴。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM