I am trying to preview a 3D model in my app without AR by using SceneView, In my app I could render the 3d model into SceneView Successfully, Now I want to center the 3d model into SceneView with rotation capability, How can I achieve this in code?
Here is how I have added the model into SceneView.
private void addModelToSceneView(ModelRenderable modelRenderable) {
Node node = new Node();
node.setRenderable(modelRenderable);
sceneView.getScene().addChild(node);
Camera camera = sceneView.getScene().getCamera();
camera.setLocalPosition(new Vector3(0f,3f,1.5f));
camera.setLocalScale(new Vector3(1f,1f,1f));
camera.setLocalRotation(Quaternion.axisAngle(Vector3.right(), -50.0f));
Toast.makeText(this, "Model Rendered Successfully", Toast.LENGTH_SHORT).show();
}
Here is how my 3d model looks like in SceneView
I want to center my 3d model into SceneView with a rotation capability similar to Google’s model previewer as shown below figure, facing forward, How can I achieve this in coding?