Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

OttoDisk

Coordinates?

This topic is 6439 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How i can get the coordinates of a vertex in a 3d solid? (ex: a cube). I need to know if i can get the coordinates for *all* the vertices that form a complex figure. Tnx to all Webmaster di: "Motori 3D: Tecniche e progettazione" http://gpi.infomedia.it/motori3d

Share this post


Link to post
Share on other sites
Advertisement
First i apologize for my poor english but i''m italian
I''ll try to explain what i mean.
Imagine that you have a cube at the middle of the screen, you don''t kown his vertices coordinates, how you can get the coordinate of every vertices?
Tnx to all

Webmaster di:
"Motori 3D:
Tecniche e progettazione"
http://gpi.infomedia.it/motori3d

Share this post


Link to post
Share on other sites

So there isn''t a function that return the coordinate of a vertex
Tnx to all

Webmaster di:
"Motori 3D:
Tecniche e progettazione"
http://gpi.infomedia.it/motori3d

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Do you mean: How do I get the screen-coordinates of a 3d-vertex?

If that is what you mean, then just push the vertex through your transformation code.

Or, do you mean: How do I generate a 3d-object from a 2d-image, if so then thats impossible, AFAIK.

Share this post


Link to post
Share on other sites
I''m confused

To have a cube in the middle of the screen you would have to already know the coordinates of each of its vertices. If you have a program drawing a cube in 3D (OpenGL, Direct3D, Sofware renderer) the coords of the cube HAVE to be in there somewhere, in some form.
So it follows that you could obtain access to that data. What''s the situation?

Stop me if I''ve totally missed the point

____________________________________________________

"Two wrongs do not make a right; it usually takes 3 or more."

Share this post


Link to post
Share on other sites
eheheheh it''s hard to explain when you have a poor english I''ll try again

For example if you have a level editor, you begin with a empty level, then you create a cube, now for saving the coordinates of the cube, what i have to do?

Tnx to all for the patience that have with me
Byez

Webmaster di:
"Motori 3D:
Tecniche e progettazione"
http://gpi.infomedia.it/motori3d

Share this post


Link to post
Share on other sites
For anonymous: Yes i mean screen coordinates

Webmaster di:
"Motori 3D:
Tecniche e progettazione"
http://gpi.infomedia.it/motori3d

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:

For example if you have a level editor, you begin with a empty level, then you create a cube, now for saving the coordinates of the cube, what i have to do?
[\quote]

When creating the cube you decide what the coordinates should be. If you don''t, there is no cube.
(assuming you are writing the level editor, if you are using a pre-existing one, then save the level-file to disk and then figure out how to read the level-format)

e.g.
say you want a cube that has sides of length 10 units, and is centered around the origin (0,0,0).
Then the coordinates of the cube''s vertices are:



(-5,5,5) (5,5,5)
+---------------+
/| /|
/ | / |
/ | / |
/ | / |
(-5,5,-5) / | (5,5,-5)/ |
+---------------+ |
| +---------|-----+ (5,-5,5)
| /(-5,-5,5) | /
| / | /
| / | /
| / | /
|/ |/
(-5,-5,-5)+---------------+ (5,-5,-5)



the positive x-axis points to the right, the positive y-axis points up and the positive z-axis points "into" the screen.

(I might have made some small mistake, but you get the general idea, I hope)

If this has nothing to do with what you were asking (I don''t quite understand the question), then please just ignore this post)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!