Closed ngokevin closed 8 years ago
Comment by dmarcos Monday Nov 16, 2015 at 19:06 GMT
What happens if the circle moves? It would be better to have a look-at
component where you pass a selector:
<vr-object look-at="#circle"></vr-object>
Comment by ngokevin Monday Nov 16, 2015 at 19:10 GMT
i like passing in a selector. might cause problems if someone specifies both look-at + rotation? since look-at modifies rotation, it makes sense that the rotation component handle both
Comment by dmarcos Monday Nov 16, 2015 at 19:15 GMT
We already have this problem with controls. Controls modify rotation and position and can collide with other changes. You can isolate changes by wrapping elements in other elements.
Comment by dmarcos Monday Nov 16, 2015 at 19:16 GMT
This is going to happen with components that apply behaviours on entities.
Comment by ngokevin Monday Nov 16, 2015 at 19:22 GMT
yeah though there's not much we can do with controls. but it might be good API design to put look-at functionality in rotation component. it:
but i do see the case for code modularity.
Comment by jcarpenter Wednesday Nov 18, 2015 at 10:45 GMT
Dupe of #317, I think.
Enables devs to tell objects to "look at" another object. This is common and extremely useful. Implementation could be via component, with something like:
<a-kitten lookat="target: bird">
Example from Cinema 4D's implementation is as follows: https://dl.dropboxusercontent.com/u/667711/mockups/target-example.mov
In C4D Look At tag takes priority over (ignores) standard object transforms.
Comment by jcarpenter Wednesday Nov 18, 2015 at 10:46 GMT
Primary use case for this is UI design, IMO.
Comment by ngokevin Wednesday Nov 18, 2015 at 18:05 GMT
Dupe https://github.com/MozVR/aframe-core/issues/317
Changed my mind, I'm okay with lookat separate component
Issue by ngokevin Monday Nov 16, 2015 at 18:42 GMT Originally opened as https://github.com/aframevr/aframe-core/issues/447
Would be nice to be able to have an object face a point without having to do calculations. For example, if we wanted things aligned in a circle, we could tell each object to look at the center of the circle.