Start a new topic

How to change attribute (height) of a component within 3D model (.wt3) dynamically


I have a component made up of a series of sub-components. Based on a dynamic value I want to render a sub-components height based on this dynamic value.

So for example, my sub-component is a rectangle, and I want to adjust this sub-components height (Y-axis) based on this value.

It's not clear to me how in wikitude I can reference a specific sub-component (Mesh?) in the model and adjust its attributes.



Thanks Daniel - I've gone down the first route which works well. My only problem now is the issue with the 3D encoder that doesn't seem to render opacity of materials very well but I raised this in another thread. 


Good morning MIke.

I'm afraid you can't. You can only set the transformation of the entire model. We do not provide access to sub-meshes. You will have to split your one model into multiple models and load them separately, such that you have an AR.Model for each sub-mesh you want to transform individually.

Alternatively, you might be able to use animations instead. For example an animation that moves a certain sub-mesh somewhere and a complementary animation that moves it back to its original position. this would not necessarily have to be a continuous animation, you could have it 'snap' from its initial position to its intended position from one frame to the other.

- Daniel

Login or Signup to post a comment