Rotation and coordinates


Please, help to clarify…

I have the GLB model of 1 simple cone. I upload it into PCEngine. Then I give to user possibility to view model from different sides (somehow). Then I need to add to model some dynamic object, for example add cube to the end of the original cone model.

Question - how it will work, based on which coordinates and how those coordinates retrieve, if user already rotate it many times?

I suppose there are will be the important additional question - is how user can look at model from different sides, how user will rotate it?:
A) by rotating camera;
B) by rotating model;
A) by rotating scene.

Which method of 360* rotation better to choose if later I need to dynamically add/remove/control objects linked to the originally uploaded models?

The exact code sample or link to tutorial of such coordinates retrieving, please.

In my game I would add an empty entity with an tag like “cube” to the cone model.
And later putt the cube model to the coords of the empty entity. It won’t matter where the cone is at that moment… :thinking:

I suppose that when at scene there are many objects - giving possibility to user to rotate view by the whole scene or by the main camera is a bad idea, because often user will face into other objects which will block good view to interested for user object. Thus the scenes with many objects seems the better way to rotate each object individually at fixed scene with fixed camera.

But then what about direction?
For example on GLB load the Cone with your pre-set empty entity directed-look directly to the top. But after user will rotate Cone MODEL (not scene or camera) at scene and you will run code “add new Cube to the coordinates of Cone empty entity” - to which SIDE-DIRECTION this new cube will look? Where will be front and back? Suppose on creation all objects must be directed-look with DEFAULT SCENE but NOT MODEL coordinates? How then rotate Cube to fit the Cone coordinates thus Cube will sit at Cone needle correctly?

So, what do think about it - PlayCanvas will create new objects with default stage orientation? Which function can direct the new just created object Cube to the same direction as Cone? Or it must be calculated manually?

if the cube is a child of the cone entity it will inherrient the rotation of the cone…
So localRotation to default should be ok…

1 Like