sceneview-android icon indicating copy to clipboard operation
sceneview-android copied to clipboard

3D Model gets re-rendered after the user moves the 3D object

Open ayasser-identity opened this issue 3 years ago • 8 comments

Hi I am still new to the whole AR thing and I don't know how this framework actually work but it's great now I am facing a problem that the shape is added over and over again and it's not re-rendered upon here is the photo of the shape : Screenshot from 2022-08-23 15-26-08 here is the photo of the shape after trying to move it down and up : Screenshot from 2022-08-23 15-25-34 I am doing something wrong I don't know what it is here is the source code that I wrote : Screenshot from 2022-08-23 15-29-02

ayasser-identity avatar Aug 23 '22 13:08 ayasser-identity

Hi! Does it happen with the sample applications or on a real device? Please insert the code as a highlighted Markdown block next time.

grassydragon avatar Aug 23 '22 13:08 grassydragon

package com.identitysolutions.a3dmodeltrial

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.lifecycle.lifecycleScope
import io.github.sceneview.SceneView
import io.github.sceneview.ar.ArSceneView
import io.github.sceneview.ar.node.ArModelNode
import io.github.sceneview.ar.node.PlacementMode
import io.github.sceneview.math.Position
import io.github.sceneview.math.Rotation
import io.github.sceneview.math.Scale
import io.github.sceneview.node.ModelNode

const val LINK_1 = "https://test-aorist-bucket.s3.amazonaws.com/models/artwork/187.1.glb"
const val LINK_2 = "https://sceneview.github.io/assets/models/MaterialSuite.glb"

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val sceneView = findViewById<SceneView>(R.id.sceneView)
        var nodeModel = ModelNode(
            position = Position(x = 0.0f, y = 0.0f, z = 0.0f),
            rotation = Rotation(y = 90.0f),
            scale = Scale(0.5f)
        )
        sceneView.addChild(nodeModel)

        lifecycleScope.launchWhenCreated {
            nodeModel.loadModel(
                context = this@MainActivity,
                lifecycle,
                glbFileLocation = LINK_2,
                autoAnimate = false,
                centerOrigin = Position(x = 0.0f, y = 0.0f, z = 0.0f),
                onError = { exception -> Log.d("Fuck", "${exception.message}") },
            )
        }
    }
}

ayasser-identity avatar Aug 23 '22 13:08 ayasser-identity

well in a real device something weird screen shot happens : Screenshot_20220823-154820

ayasser-identity avatar Aug 23 '22 13:08 ayasser-identity

Thank you for the report! I'll check that on my Google Pixel 3a.

grassydragon avatar Aug 24 '22 08:08 grassydragon

Hi. It could be a surface clearing issue. Can you try setting an opaque background on the SceneView?

ThomasGorisse avatar Aug 26 '22 06:08 ThomasGorisse

The sample-model-viewer application works fine on the latest main branch in my case:

Model Viewer

grassydragon avatar Aug 26 '22 06:08 grassydragon

Hi. It could be a surface clearing issue. Can you try setting an opaque background on the SceneView?

I have the same issue while rendering a ModelNode on SceneView. I tried white background on SceneView but couldn't see the model at all.

nayash avatar Aug 31 '22 13:08 nayash

On Pixel 4a (5G)

Screenshot_20220920_142203

lukaloens avatar Sep 20 '22 12:09 lukaloens

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 20 '22 05:12 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Dec 27 '22 05:12 github-actions[bot]