Night Programmer
Night Programmer

Reputation: 341

Conversion of 2d coordinates to 3d coordinates

In my project previously i used 2d Map. as per costumer requirement they want 3d map. But 3rd party provide only X and Y. In that project some Objects are static so I placed manually. But some Objects are dynamically changed the position. That object need X , Y , Z How to internally convert X Y to X Y Z

Some Static Objects Coordinates : in 2D X: 865 Y: 950 In 3d X:-54.2,Y:11.6,Z:17.5

in 2D X: 813 Y: 945 In 3d X:-54.4,Y:12.4,Z:24.1 2D Map

Upvotes: 1

Views: 1760

Answers (1)

Night Programmer
Night Programmer

Reputation: 341

Find the relation between xy coordinates in 2D and xz coordinates in 3D. When you get it, you’ll solve a half of the question. Next, to find y in 3D. I would use THREE.Raycaster() with THREE.Vector(0, -1 ,0) direction and its origin is higher than the highest point on the 3D map.

Upvotes: 1

Related Questions