Placing one entity relative to another.

Hi,

I am trying to place a sphere at a relative position of a point on an entity, e.g., the wing-tip of the aircraft model or the top corner of the milk truck model. Computing the model matrix of the model it might appear straightforward to apply a translation and generate a model matrix but (for what are probably good reasons) it isn’t possible to set the model matrix of an entity.

I wondered if anyone had any suggestions as to how this might otherwise be achieved? There is a thread referring to the use of # to use a reference frame relative to the reference frame of another entity but it seems to peter out in 2016 and that approach doesn’t seem to work if coded.

Many thanks,

Hugh

Hi Hugh,

While you can’t set the model matrix of an entity, you can get it, then use that to transform your relative position to world space.

Here’s a working example.

Thanks!

Gabby

Perfect, Gabby. Thank you!