• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Getting 2d coords from 3d object

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1Shawn619  Members

Posted 23 August 2013 - 12:42 PM

Like in tf2, I'm wanting to use the technique of displaying bullet damage in an FPS game by way on 2d text above where the bullet hits the target in 3d like so:

My only problem is that I don't know how to translate this 3d position of where the bullet hit into 2d. Any ideas?

### #2shazen  Members

Posted 23 August 2013 - 02:35 PM

Most frameworks or libraries have a method to transform a 3dvector.

Vector3 temp = Vector3.Transfom(3dposition, view * projection);

Vector2 screenPosition = new Vector2(temp.x, temp.y);

### #3cozzie  Members

Posted 24 August 2013 - 06:58 AM

You could try to look upsome tutorials on 'picking' (that's the technique your describing).
It is/ can be based on 'shooting a ray' from the camera position through space, and looking which objects/ meshes you're intersecting

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

### #4Irlan Robson  Members

Posted 23 September 2013 - 08:27 AM

You can use picking + time of impact just as @cozzie described above to estimate the contact point.

A good tutorial: http://www.rastertek.com/dx11tut47.html

Edited by irlanrobson, 23 September 2013 - 08:27 AM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.