Bonzai Engine Forum
Bonzai Engine & Tools => Bonzai Engine on Android => Topic started by: Peter Yeremenko on June 22, 2012, 03:30:53 PM
-
I'm developing augmented reality application using Qualcomm QCAR framework. For correct displaying of the object I use model view matrix and projection matrix provided by QCAR.
I'm using these matrices like listed below:
Everything is ok, but I need to rotate the model. Is there any method like model.setRotationX(angle) in Bonzai or I need to multiply my modelViewMatrix on another rotation matrix. I am afraid that when modelViewMatrix will be multiplied by the rotation matrix, model will rotate about the origin, and not about the center of the model.
Please explain me, how can the model be rotated about it's center.
-
And one more question
I've loaded flower_6.fbx model from models pack (http://dexsoft-games.com/models/medieval_free.html) that been advised in neighbour thread.
But branches of plant displayed without transparency. Bonzai editor have transparency flag which makes every branch of plant transparent. So, how can I do the same using bonzai?
-
You can position a model using a Transform object (which can be created from a matrix if needed).
The model origin is not always it's center, so you'll have to use it's bounding box to find it's center and rotate from that point. Bounding box is accessible from in Model using getBoundingVolume (search in tutorials which uses that).
But branches of plant displayed without transparency. Bonzai editor have transparency flag which makes every branch of plant transparent. So, how can I do the same using bonzai?
To force using alpha channel of diffuse texture as transparency on all materials, use the following:
You can also do it per material using methods in Material object.
-
Thank you a lot! It works fine.