HTWG-VirtualReality / prototyp

0 stars 0 forks source link

Fix position of new created element by click #52

Open T1m1 opened 7 years ago

T1m1 commented 7 years ago

Position of element only fits if user click at center.

phaldan commented 7 years ago

Where should it be place instead? Currently it is placed on position from the click on the background.

phaldan commented 7 years ago

Currently using window x and y coordinates of the cursor to determine position for element creation, but scaling of window coordinates and threejs coordinates doesn't match. To fix this problem we could use the approach of an threejs demo with dragable boxes: https://threejs.org/examples/webgl_interactive_draggablecubes.html