arunkumarka
Lurker
I was not able to render 3D object using ScenView of SceneForm library . I tried ModelRendarable and Node classes to make it , but not worked . Please help me to get this problem out .
Code snippet is given below .
sceneView=(SceneView)findViewById(R.id.scene_view);
Camera camera = sceneView.getScene().getCamera();
camera.setLocalRotation(Quaternion.axisAngle(Vector3.right(), -30.0f));
ModelRenderable.builder()
// To load as an asset from the 'assets' folder ('src/main/assets/andy.sfb'):
.setSource(this, Uri.parse("car.sfb"))
.build()
.thenAccept(
renderable -> mr = renderable
)
.exceptionally(
throwable -> {
Log.e("arun", "Unable to load Renderable.", throwable);
return null;
});
Node andy = new Node();
andy.setParent(sceneView.getScene());
andy.setLocalPosition(new Vector3(0f,0,-1f));
andy.setRenderable(mr);
Code snippet is given below .
sceneView=(SceneView)findViewById(R.id.scene_view);
Camera camera = sceneView.getScene().getCamera();
camera.setLocalRotation(Quaternion.axisAngle(Vector3.right(), -30.0f));
ModelRenderable.builder()
// To load as an asset from the 'assets' folder ('src/main/assets/andy.sfb'):
.setSource(this, Uri.parse("car.sfb"))
.build()
.thenAccept(
renderable -> mr = renderable
)
.exceptionally(
throwable -> {
Log.e("arun", "Unable to load Renderable.", throwable);
return null;
});
Node andy = new Node();
andy.setParent(sceneView.getScene());
andy.setLocalPosition(new Vector3(0f,0,-1f));
andy.setRenderable(mr);