• 7
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

how to rotate a 3d model rendered with ARCORE SceneView

how to rotate a 3d model rendered with ARCORE SceneView i have used Sceneview

private lateinit var scene: Scene private lateinit var node: Node

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.act_main)

    scene = sceneView.scene
    render(Uri.parse("coffee_cup.sfb"))
}

private fun render(uri: Uri) {
    ModelRenderable.builder()
        .setSource(this, uri)
        .build()
        .thenAccept {
            addNode(it)
        }
        .exceptionally {
            Toast.makeText(this, "Error", Toast.LENGTH_SHORT).show()
            return@exceptionally null
        }

}

private fun addNode(model: ModelRenderable?) {
    model?.let {
        node = Node().apply {
            setParent(scene)
            localPosition = Vector3(0f, -2f, -7f)
            localScale = Vector3(3f, 3f, 3f)
            renderable = it
        }

        scene.addChild(node)
    }

Within the code block of Node().apply, add the following:

localRotation(Quaternion.axisAngle(new Vector3(-1f, 0, 0), 90f));

Modify the (X,Y,Z) values according to how you want the object rotated. The coordinates I provided will make the object face the camera.

  • 1
Reply Report