programering 105 Report post Posted August 18, 2004 I don't understand the articles about texture mapping. And why one uses homogeneous coordinates. In a matrix vertex: [ Px ] [ Py ] [ Pz ] [ 1 ] <-- is this a homogeneous coordinate x = x * matrix[row 0][col 0] + y * matrix[row 0][col 1] + z * matrix[row 0][col 3] + matrix[row 0][col 4]; <-- this add on? A * x + B * y + C * z + D = 0 is D the homogeneous coordinate? I don't quite understand the equation can someone explain how it works? I might need an illustration maybe. 0 Share this post Link to post Share on other sites
programering 105 Report post Posted August 18, 2004 is D negative? 0 Share this post Link to post Share on other sites
nmi 978 Report post Posted August 18, 2004 Quote:Original post by programeringA * x + B * y + C * z + D = 0This is the equation of a plane. A, B, C and D are the parameters of the plane. Any point P = (x, y, z) that makes this equation true is in the plane. If D == 0, then the point (0, 0, 0) will also be in your plane, your plane is goin through the origin.Homogeneous coordinates:If you have a point P1 = (x, y, z, w) in homogeneous coordinate space, then you can transform it into a 'normal' 3D coordinate space point P2 = (x/w, y/w, z/w).You can see that many points in homogeneous space represent the same point in 3D space. If w is zero, you actually specify a direction.Homogeneous coordinates are useful when doing transformations in 3D space. With a 3x3 matrix you can calculate rotations and you may scale objects, but you cannot translate them to another position. But if you use 4D homogeneous coordinates and set w to one, this allows to specify the translation as part of your transformation matrix (4th column). 0 Share this post Link to post Share on other sites
programering 105 Report post Posted August 18, 2004 can you give an example, an illustration? 0 Share this post Link to post Share on other sites
programering 105 Report post Posted August 19, 2004 I haven't done the math c course in shool.what are A, B, C and D? are they vectors? 0 Share this post Link to post Share on other sites
programering 105 Report post Posted August 19, 2004 the values of A, B, C and D.demonstrate a concrete example.I may be stupid who don't understand. 0 Share this post Link to post Share on other sites
EvilSwan 122 Report post Posted August 19, 2004 Try www.mathworld.com Any math related question I've ever had, the pages there have answered. 0 Share this post Link to post Share on other sites
Vlion 151 Report post Posted August 19, 2004 First off, don't multiple post pointlessness.If someone feels like answering, they will.All the spamming does is piss people off.We use homogeneous coordinates so that we can do matrix multiplications for translations. We like matrix muls because they neatly represent rotations and scalings as well.So we simply work with a system that lets us do everything by matrix muls.Look up the difference between affine and linear transforms, and then work through rotation and translation with 3x3 and 4x4 matrices and see which ones are affine and which ones are linear. 0 Share this post Link to post Share on other sites
programering 105 Report post Posted August 25, 2004 I have no experience about this, I need to learn.Sorry for the spamming.But I want to understand this logical on how it works.And I can't really find anything that helped me understand this with google.comAnd you've rote me down for wanting help, witch makes me a bit sad.next you'll maybe rate me to zero, close my/this thread and ban me.you experience me as irritating, but what shall I do when I what to understand this so badly.How the equation A * x + B * y + C * z + D can be equal to zero.[Edited by - programering on August 25, 2004 8:02:43 AM] 0 Share this post Link to post Share on other sites
programering 105 Report post Posted August 25, 2004 A concrete example, then I'll shut up. 0 Share this post Link to post Share on other sites
Ajare 174 Report post Posted August 25, 2004 As EvilSwan said, try MathWorld.http://mathworld.wolfram.com/HomogeneousCoordinates.htmlIf you don't understand that, I don't see what good a 'concrete example' will do you, but here you go anyway:x = 0y = 0z = 0d = 0 0 Share this post Link to post Share on other sites
Guest Anonymous Poster Report post Posted August 25, 2004 I don't know if I've understand this either, but I'll try to explain what I think/know...A*x + B*y + C*z - D = 0 ( IMHO: Clearer to use -D than + D )( vectors describes a direction and length, and remember a plane has infinite size and is infinite thin )ABC are the x, y, z component of the plane's (unit)normal vector.D = distance from the origin to the closest point on the plane.xyz = any point in the plane.if not xyz lays in plane the equation wont equal zero.Imagine a plane with center p0 laying horizontally 3 units above the ground.p0 = [0, 3, 0]Normal = [ 0, 1, 0 ] (Pointing straight up, A=0, B=1, C=0)D = A*p0.x + B*p0.y + C*p0.z = 0*0 + 1*3 + 0*0 = 3p1 = [ 5, 3, 10 ] ( a coordinate in the plane )p2 = [ 5, 2, 10 ] ( a coordinate below the plane )A*p1.x + B*p1.y + C*p1.z - D = 0*5 + 1*3 + 0*10 - 3 = 0 (in plane)A*p2.x + B*p2.y + C*p2.z - D = 0*5 + 1*2 + 0*10 - 3 = -1 (out of plane)Just remember the normal must have a length of 1! (normalized)If you find this confusing think like this (even if it's not entirly correct):A*x + B*y + C*z - D = 0 so: A*x + B*y + C*z = D[ A, B, C ] is the unit normal, or direction of the plane, so we are multiplying the x coordinate (how far away the plane is from the x-axis) with normal.x (how much the plane is tilted in direction x). And the same with y and z. Homogenous coordinates are "projected coordinates", if w = 1,the 3d coordinates equals the "projected coordinates". Smaller w projects coordinates farther out. If w = 0, the coordinates are projected at infinity. Usually you just want w = 1. It's used so a 4 element vertex can be multiplied with a 4x4 matrix. A 3x3 matrix can only hold scaling and rotation, not translation. Pretend that every time your program draws a vertex x,y,z and multiplies it with your transformation matrix, it just sets w=1. (OpenGL actually does this, ASFAIK) 0 Share this post Link to post Share on other sites
Guest Anonymous Poster Report post Posted August 25, 2004 btw... sorry for the bad english and messy post... just tried to come with a "concrete" example... And as I said, i don't know this stuff either :-P 0 Share this post Link to post Share on other sites
Chris Hare 462 Report post Posted August 25, 2004 y = mx + c defines a line in 2d, where m and c are known values and x and y are line coordinates. Ax + By + Cz + D = 0 defines a plane in 3d, with A, B, C and D known 'parameters.' D has nothing to do with homogenous coordinates. 0 Share this post Link to post Share on other sites
programering 105 Report post Posted September 1, 2004 I can't really picture it in my mind.If I could find a picture witch demonstrates it.But I don't know what I shall search on with google. 0 Share this post Link to post Share on other sites
Paradigm Shifter 5832 Report post Posted September 1, 2004 1st site from searching for "plane equation"http://mathworld.wolfram.com/Plane.htmlYou need to learn a lot of linear maths before you will be able to grasp how homogeneous coordinates work. Projective Geometry is a good search word on google, but its complicated and you need to know what a vector space is. 0 Share this post Link to post Share on other sites
programering 105 Report post Posted September 1, 2004 I'm thinking... 0 Share this post Link to post Share on other sites
programering 105 Report post Posted September 1, 2004 I can't find anything on the net that really get me to understand this.Can somebody draw a picture of this, with mspaint or something?and post it. If you got nowhere to host it, you can send it to me: callecutta_k@hotmail.comThen I'll rate you good. 0 Share this post Link to post Share on other sites
boebi 100 Report post Posted September 1, 2004 Take Linear Algebra in college, then you'll understand this. Until then, just take advantage of how useful this can be. The 4th component of a vector simply allows you to transform a point (represented by the first three components) by any matrix (which is also 4x4). Just know that for normal 3D work, you just make the 4th component 1. That's it. Until you have a strong background in Linear Algebra, you prolly won't understand this. 0 Share this post Link to post Share on other sites
programering 105 Report post Posted September 1, 2004 is D the length of the normal?is it?[Edited by - programering on September 1, 2004 10:46:55 AM] 0 Share this post Link to post Share on other sites
programering 105 Report post Posted September 1, 2004 yes or no? 0 Share this post Link to post Share on other sites
Guest Anonymous Poster Report post Posted September 1, 2004 You're talking about three different issues here. Homogenous coords have very little to do with the plane equation. I also don't see what texturing has to do with all this. If you want to know about homogenous coordinates read the earlier replies and search the web.The plane equation A * x + B * y + C * z + D = 0 is true for all points that lie on a plane, parametrized by A, B, C and D. If you don't get it, get a good book on geometry or search the web. D is not the length of any normal, it's the plane's offset from origo.If you want to go on trolling/get banned/something, keep up the good work :) 0 Share this post Link to post Share on other sites
Paradigm Shifter 5832 Report post Posted September 1, 2004 Quote:Original post by Anonymous PosterThe plane equation A * x + B * y + C * z + D = 0 is true for all points that lie on a plane, parametrized by A, B, C and D. If you don't get it, get a good book on geometry or search the web. D is not the length of any normal, it's the plane's offset from origin.Only if the plane normal is actually normalised, its the amount you multiply the normal by to reach the plane from the origin otherwise.As was clearly explained on the Wolfram site (to the OP). Near the diagram. 0 Share this post Link to post Share on other sites
Guest Anonymous Poster Report post Posted September 1, 2004 Another useful thing about it is that if w = 0, you have a vector. The same transformation matrices will work with the vector. Rotations and scalings will work while translations have no effect (because a vector has no position). 0 Share this post Link to post Share on other sites
programering 105 Report post Posted September 2, 2004 I got low experience of this (math).I probably need pre-knowledge.I missed some math in school.I suspect there's knowledge before this I haven't learned yet.How do I define a vector's direction and length?[Edited by - programering on September 2, 2004 5:42:32 AM] 0 Share this post Link to post Share on other sites