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 .
Can you tell me how i change it rotation so its look like this one image
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 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 .
Can you tell me how i change it rotation so its look like this one image