5 replies to this topic

Posted 15 June 2014 - 08:19 PM

In my tut lesson we start talking about untransformed vertices and the geometry pipeline. I have a prob here understanding things, from the get go!
The coordinates of the vertices (untransformed) are:
3.0f, -3.0f, 0.0f
0.0f, 3.0f, 0.0f
-3.0f, -3.0f, 0.0f
i don't understand these coordinates. On a piece of paper i drew a coordinate system X (horizontal) and Y (vertical) intersecting at (0, 0) and X >0 at the right side of (0, 0) and Y >0 above (0, 0). I built a triangle by plugging in the above coordinates. BUT the vertices are in counter-clockwise order. So my representation must be wrong, no!?
And also these coordinates: is there a range of values for each coordinate (x, y, z). How can i determine a particuler shape for my triangle?

Posted 15 June 2014 - 08:50 PM

Defining vertices in that order (counter clockwise) gives you a normal pointing "out" of the XY plane, i.e, a normal on the Z axis with a positive value. Why do you think it's wrong? How do you think it should be and why? Do you know about orthogonal vectors and cross product? http://en.wikipedia.org/wiki/Cross_product

X, Y and Z are real numbers representing a point in space. In theory there's no limit for them, any coordinate of a point in a 3 dimensional space can have any value between minus infinity and infinity. In practice there's a limit when you try to put those numbers inside a computer, since X, Y and Z must be stored in a fixed amount of bits. It depends on the platform you're using, but most of the times you don't worry about it unless you need both really small and really big numbers at the same time. When you work with numbers between a small range you can always think of the values as meters, kilometers, centimeters, miles, or whatever fits better in that case.

What do you mean with "how can I determine a particular shape for my triangle?"?

Posted 15 June 2014 - 09:30 PM

I thought that if you present the vertices in a counter-clockwise order the vertices would not be displayed on screen: i probably misunderstood...
Now you threw me for a loop: normals, orthogonal vectors, cross product ?? I beefed up on vector algebra, matrices, etc. Your reply makes me view things very differently.
As to your last question: you gave the answer: i give the coordinates i want to obtain a particuler triangle (isoceles, equilateral or some particular shape).
I have just started this tut lesson, the author says that for a beginner it's like studying pointers...so there will be other questions but for now i am going to play w/ the code try to do the exercises to understand better.
Thank you for your help.
Phil

Posted 15 June 2014 - 10:10 PM

I thought that if you present the vertices in a counter-clockwise order the vertices would not be displayed on screen: i probably misunderstood.

Perhaps not. In some APIs (application programming interface), counter-clockwise is the default order. In other APIs, clockwise is the default order. Many APIs support changing the default order during rendering.

Determining whether a particular triangle gets rendered depending on the order of the vertices is called culling. If clockwise order is the default, then, if the vertices of a triangle appear from a particular direction to be in clockwise order, then that is called the "front face" of the triangle. The back face is the same triangle as viewed from the opposite direction, say, from "behind." From the "behind" direction, the vertices appear in counter-clockwise order. As mentioned, many APIs allow the program to set backface culling or frontface culling as an option.

**Edited by Buckeye, 15 June 2014 - 10:13 PM.**

Please don't PM me with questions. Post them in the forums for *everyone's* benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Posted 16 June 2014 - 03:51 AM

In D3D9 you control the culling mode with D3DRS_CULLMODE and set it to CCW, CW or No culling. You sometimes might want to change this value because of how you are rendering things.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max