You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am rendering .glb file in my app. I am getting .glb file from the local storage of mobile objects color is completely black IDK what is happening. but when I am getting the same file from asset in Android studio it is working perfectly fine all the colour of object are showing perfectly even if I am getting the year object from URL it is working fine here is but I am doing please help me with this. @ThomasGorisse, or someone else, do you know, how can I fix that? Is it possible?
sceneView = findViewById<ARSceneView?>(R.id.
sceneView
).
apply
{
lifecycle = [email protected]
planeRenderer.isEnabled = true
configureSession { session, config ->
config.
depthMode
= when (session.isDepthModeSupported(Config.DepthMode.
AUTOMATIC
)) {
true -> Config.DepthMode.
AUTOMATIC
fun buildModelNode1(file: File?): ModelNode? {
// val file = File(cacheDir, "DamagedHelmet.glb")
if (file == null) {
Log.e("FileCheck", "File does not exist: ")
return null
}
Log.d("FileCheck", "File exists: ${file.
absolutePath
}")
sceneView.modelLoader.createModelInstance(file = file).
let
{ model ->
return ModelNode(
modelInstance = model,
// Scale to fit in a 0.5 meters cube
scaleToUnits = 0.5f,
// Bottom origin instead of center so the model base is on floor
// centerOrigin = Position(y = -0.5f)
centerOrigin = Position(x = 0.0f, y = -1.0f, z = 0.0f)
).
apply
{
isEditable = true
}
}
}
The text was updated successfully, but these errors were encountered:
I am rendering .glb file in my app. I am getting .glb file from the local storage of mobile objects color is completely black IDK what is happening. but when I am getting the same file from asset in Android studio it is working perfectly fine all the colour of object are showing perfectly even if I am getting the year object from URL it is working fine here is but I am doing please help me with this.
@ThomasGorisse, or someone else, do you know, how can I fix that? Is it possible?
sceneView = findViewById<ARSceneView?>(R.id.
sceneView
).
apply
{
lifecycle = [email protected]
planeRenderer.isEnabled = true
configureSession { session, config ->
config.
depthMode
= when (session.isDepthModeSupported(Config.DepthMode.
AUTOMATIC
)) {
true -> Config.DepthMode.
AUTOMATIC
else -> Config.DepthMode.
DISABLED
}
config.
instantPlacementMode
= Config.InstantPlacementMode.
DISABLED
config.
lightEstimationMode
= Config.LightEstimationMode.
ENVIRONMENTAL_HDR
}
onSessionUpdated = { _, frame ->
if (anchorNode == null) {
frame.
getUpdatedPlanes
()
.
firstOrNull
{ it.
type
== Plane.Type.
HORIZONTAL_UPWARD_FACING
}
?.
let
{ plane ->
addAnchorNode(plane.createAnchor(plane.
centerPose
))
}
}
}
onTrackingFailureChanged = { reason ->
[email protected] = reason
}
}
// buildModelNode()?.let { addChildNode(it) }
isLoading = false
}
anchorNode = this
}
)
}
fun addAnchorNode(anchor: Anchor) {
apply
{
isEditable = true
lifecycleScope
.
launch
{
isLoading = true
buildModelNode()?.
let
{ addChildNode(it) }
// buildViewNode()?.let { addChildNode(it) }
isLoading = false
}
anchorNode = this
}
)
}
fun buildModelNode1(file: File?): ModelNode? {
// val file = File(cacheDir, "DamagedHelmet.glb")
if (file == null) {
Log.e("FileCheck", "File does not exist: ")
return null
}
Log.d("FileCheck", "File exists: ${file.
absolutePath
}")
sceneView.modelLoader.createModelInstance(file = file).
let
{ model ->
return ModelNode(
modelInstance = model,
// Scale to fit in a 0.5 meters cube
scaleToUnits = 0.5f,
// Bottom origin instead of center so the model base is on floor
// centerOrigin = Position(y = -0.5f)
centerOrigin = Position(x = 0.0f, y = -1.0f, z = 0.0f)
).
apply
{
isEditable = true
}
}
}
The text was updated successfully, but these errors were encountered: