#### Archived

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

# 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.

## 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 on other sites
I don''t think I understand the question

##### Share on other sites
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 on other sites
That would be hard. I think.

But if you are looking for a way to "generate" coord''s for a square for example, thats quite possible.

=======================
Game project(s):
www.fiend.cjb.net

##### 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 on other sites
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 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 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 on other sites
For anonymous: Yes i mean screen coordinates

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

##### Share on other sites
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)

• 40
• 12
• 10
• 10
• 9
• ### Forum Statistics

• Total Topics
631371
• Total Posts
2999606
×