WebKit / explainers

Explainers from WebKit contributors
371 stars 28 forks source link

For an interactive <model> which is being transformed the 3D model or a virtual camera? #81

Closed mikkoh closed 2 years ago

mikkoh commented 2 years ago

The interactive attribute is described as a mechanism to allow the user to rotate and zoom the 3d model. Later the pointerdown, mousedown, and touchstart events are associated to this mechanism where preventDefault can be called to disable zoom or rotation.

In an interaction scenario when a user has touched or clicked the <model> element and the 3d model is rotated. Are transformations applied to the 3D Model or a virtual camera which is rendering the 3D model? The same question would apply for zoom.

In the explainer document there's an assumption that the 3D model is lit. Is it more ideal for the lighting to remain static as the model is transformed or appear dynamic as the model is transformed?

grorg commented 2 years ago

Good points - we don't make this clear in the explainer.

I think for the first pass it would be the virtual camera that is being transformed in an interactive mode. This would mean that any shadows cast by the 3d object would be static, since the source of lighting is also transformed relative to the camera.

As we expose more of the structure, it would be easy to choose if you want to transform the root entity or the camera.