Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

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


Sign up now

3D Math problems... No idea what to ask from Google.

4: Adsense

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.


  • You cannot reply to this topic
2 replies to this topic

#1 Sollum   Members   

1145
Like
0Likes
Like

Posted 10 September 2012 - 06:13 AM

Good afternoon.

I am on a holidays right now, and got a spare week for my own codding fun. Decided to do some 3D programming and i've stumbled upon one problem.

At the moment i am doing a simple task really.
Theres a cube "starting" at X0, Y0, Z0 position and theres "me" at X1, Y1, Z1.

I want to determine if am "targeting" the cube (like Minecraft).

For example:
[WhereIStand]:[-2.1618571][-2.5086415][-2.299999] - My location cordinate
[WhereILook]:[0.7986355][0.60181504][0.52991927] - My view vector (Where i am looking at)
[WhereCubeIs]:[0][0][0] - Cubes location cordinate
[CubeVector]:[1][1][1] - Cubes "Growth" vector

And after this i am stuck.

My problem is that i don't know what to ask of google.

I was thinking about two solutions:
A) Shoot a "missile", it will hit after some time, and i will know if i am "targeting" cube or no. (Kinda retarded idea)
B) 3D Projection into 2D (Get X and Y out of X, Y, Z), no idea how to achieve that. Plus i will dig a grave with it for myself.

This problem is succesfully solved in software like 3D Max or Wings 3D, you can even select a polygon.

#2 Ashaman73   Members   

13715
Like
2Likes
Like

Posted 10 September 2012 - 06:23 AM

Google for "3d picking"

Edited by Ashaman73, 10 September 2012 - 06:23 AM.

Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log


#3 monkeyboi   Members   

188
Like
0Likes
Like

Posted 10 September 2012 - 02:42 PM

Picking or ray tracing is what you need to learn from this. Maybe frustum culling as well.

Jerry




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.