World space transformation data

Hi,

I’m unsure if I’ve missed something in the documentation, but I haven’t been able to find any mention of retrieving an objects transformation data in relation to something other than its parent or whatever is set with relativeTo. I was hoping to be able to pass a flag to the position() getter and getting world space coordinates in return. I guess world space means in relation to root origin in the case of Zappar, but I’m not sure how your scene relations work under the hood.

I was trying to do calculations with camera position and rotation included and tried to grab said values from Z.camera.position() but as it always returns [0, 0, 0] I assumed it’s because the position() method is returning the local position. I’m trying to dig up the camera position in relation to a target object.

Is it possible to do this in some way in the current version of Studio? I feel like it must be and I’m just missing something silly.

Hi There,

At the moment there is no easy way to explain how to do what you’re looking to do in ZapWorks Studio as there isn’t really the concept of ‘world space’.

That being said we are currently documenting TriggerRegions (a big part of ZapBox experiences) which might be useful to you, hopefully, you don’t mind waiting while we work on getting this documentation out :slight_smile:

In the meantime would you mind explaining a little more about your project and what you’re looking to build?

Thanks,
Mark

Hi Mark, thank you for replying!

I see. Is there a complicated way to explain how to do this? I understand that there is no ‘world space’ concept available in Studio as is, but getting access to the camera transforms in relation to the target seems like a really useful feature and I’m assuming it’s just a matter of opening up the API.

Hehe, yes, I did think about going around this issue with an array of TriggerRegions and a tagged activator node attached to the camera, but the idea felt too much like a hack to use in actual projects :sweat_smile: Looking forward to seeing the docs on these.

Sorry I couldn’t get back to you before. I have a list of things I’d like to try but they require knowing the camera / viewport transform matrix in relation to scene origin / target. For example; faking reflections with view-angle dependent material blending, “rigging” characters to look towards the user, various UX assets (guiding the user to look in the right direction etc.) among others. These are related to an arsenal of features (subsymbols) I’m planning and building for future projects :wink:

Hey Eero,

We accelerate the matrix maths in C++, as a result, the final matrices are not accessible from the JS environment.

The TriggerRegion docs are now live so hopefully they will provide the insight you need - https://docs.zap.works/studio/scripting/reference/triggerregion/

Thanks,
Mark