SceneView / sceneform-android

Sceneform Maintained is an ARCore Android SDK with Google Filament as 3D engine. This is the continuation of the archived Sceneform
https://sceneview.github.io/sceneform-android/
Apache License 2.0
633 stars 145 forks source link

Avatar Hand rotation not working properly #443

Closed Amitdygon closed 1 year ago

Amitdygon commented 1 year ago

Hello Support

I have changed the Arms bones and do changes but its not looking good here i have upload the code and Image ` private fun Int.getTransform(): Mat4 { val tm = binding.transparentSceneView.scene.renderer?.filamentRenderer?.engine?.transformManager val arr = FloatArray(16) tm?.getInstance(this)?.let { tm.getTransform(it, arr) } return Mat4.of(*arr) }

private fun Int.setTransform(mat: Mat4) {
    val tm =
        binding.transparentSceneView.scene.renderer?.filamentRenderer?.engine?.transformManager
    tm?.getInstance(this)?.let { tm.setTransform(it, mat.toFloatArray()) }
}

private fun changeBones(){ filament?.releaseSourceData() val leftEntity= filament?.getFirstEntityByName("LeftArm")?.let { val defaultTransform = it.getTransform() val transform = rotation(Quaternion(1F, 0f, 0f, Math.PI.toFloat())) it.setTransform(transform) } val rightEntity = filament?.getFirstEntityByName("RightArm")?.let { val defaultTransform = it.getTransform() val transform = rotation(Quaternion(1F, 0F, 0F, Math.PI.toFloat())) it.setTransform(transform) } filament?.animator?.updateBoneMatrices() }` and result is looking like this . image

Can you tell me how i change it rotation so its look like this one image image