x


How do you map touch points to world space?

Simple question, but the answer might be slightly less simple: How do you map touch points to world space?

Simple example - say you have a sphere, and you want it to move to wherever your finger touches it on your device screen.

more ▼

asked Dec 21 '10 at 09:57 AM

ina gravatar image

ina
3.3k 492 549 599

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Look into Camera.ScreenToWorldPoint (or one of the similar ones). It allows you to convert screenspace coordinates to worldspace. The only problem is that screenspace is 2d and worldspace is 3d, so you might need to construct ray and cast it on the ground to find out where on the ground your sphere should be or something like that. It depends on what your final goal is.

more ▼

answered Dec 21 '10 at 10:20 AM

Paulius Liekis gravatar image

Paulius Liekis
7.3k 16 24 45

can you provide an example which converts touch points to worldspace and get the points touched using raycast

Oct 19 '12 at 05:08 AM Parikshit Singh
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3000
x2473
x1999
x580
x151

asked: Dec 21 '10 at 09:57 AM

Seen: 2450 times

Last Updated: Oct 27 '12 at 08:15 AM