0

I've a problem with controls.target.set

A page to explain : http://1id.xyz/stackoverflow/newOrbit.php

The yellow ring is the original orbit, it work.

If i drag the blue dot and set the controls.target on a new position. (the blue ring position) the camera don't orbit around this new target position.

Why ?

Treize Cinq
  • 417
  • 5
  • 16

1 Answers1

0

The draggable you're using is 2D (html element) and your scene is 3D. In other words, you have screen coordinates and you're looking for world coordinates.

Knowing this, you'll need to raycast from your mouse x,y position and find the intersection point x,y,z on your 3D plane.

Here's a similar question and a pointer to a possible solution.

Community
  • 1
  • 1
Console-buche
  • 405
  • 3
  • 12
  • Thks, BUT, sorry`controls.target` is NOT SET on bluedot x,y screen, If you want, I can do another example : `controls.target.set(blueRing.position.x, blueRing.position.y, blueRing.position.z);` Check the console.log – Treize Cinq Jun 01 '16 at 17:16