-
Hi, I render a .glb model without ModelViewer in my app. It appears only when I detect a plane, and move well with my screen. But when I move the screen, the size of the model varies depending on how far away the model is from me. It's very big near from me, and more little when it's far. I don't know if I can set a fix size of my model without ModelViewer, just with the filamentAsset, or other way? I have heard of the Manipulator but it seems to me that it only acts on the camera. filamentAsset =
withContext(Dispatchers.IO) {
@Suppress("BlockingMethodInNonBlockingContext")
context.assets
.open("post_android_v2.glb")
.use { input ->
val bytes = ByteArray(input.available())
input.read(bytes)
filament.assetLoader.createAssetFromBinary(ByteBuffer.wrap(bytes))!!
}
}
.also { filament.resourceLoader.loadResources(it) } Thanks you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To achieve what you want you'll need to use an ortho camera instead of a perspective camera. If you don't want the entire scene to behave this way you'll have to compute a scale factor for your renderable based on its distance to the camera. |
Beta Was this translation helpful? Give feedback.
To achieve what you want you'll need to use an ortho camera instead of a perspective camera. If you don't want the entire scene to behave this way you'll have to compute a scale factor for your renderable based on its distance to the camera.