   (Solved)Halfway Point Between Vertices
  How can I find the halfway point between two vertices.I'm going to be putting a point on the edge halfwaybetween two vertices.ThanksSteve[Edited by - Steve5050 on September 17, 2007 8:11:13 PM]
  How can you find the half point between two numbers?   ;  Just take the mean average of each component (x, y and z) of the two vertices.xmid = (x1 + x2) * 0.5;   ;  Ha Funny,Well I know about division.I trying to put a point on an edge.How do I do it?v1.x / v2.xThat doesn't work.   ;  That isn't working dmatter,thats in the center of a cube.I'm trying to put a point on a edge.This is in the center:  Dim M As Double  M = (mV1.x + mV2.x) * 0.5//also tried  M = (mV1.x + mV2.x) / 2//also tried  M = (mV1.x - mV2.x) / 2Gl.glBegin(Gl.GL_POINTS)   Gl.glVertex3dv(M)   Gl.glVertex3dv(mV1.x)   Gl.glEnd()   Gl.glBegin(Gl.GL_POINTS)   Gl.glColor3f(1.0F, 0.0F, 1.0F)   Gl.glVertex3dv(mV2.x)   Gl.glEnd();  It's not working because you're only doing it for the x-component.  I actually said 'each component (x, y and z)'.The code I gave you was only an example of how to do it for x, you must repeat that snippet for the y and z values too.My fault, I should have been clearer.   ;Quote:Original post by Steve5050How can I find the halfway point between two vertices.I'm going to be putting a point on the edge halfwaybetween two vertices.ThanksSteveTo find the midpoint between two vertices on an edge just do this:Assume (x1,y1,z1) is vertex 1, and (x2,y2,z2) is vertex 2.MidX = (x1 + x2) * 0.5;MidY = (y1 + y2) * 0.5;MidZ = (z1 + z2) * 0.5;your midpoint is located at the vertex (MidX,MidY,MidZ).done,cheers,Paul.   ;  Dead On!Thanks dmatter.   Dim M, M1, M2 As Single   M = (mV1.x + mV2.x) * 0.5   M1 = (mV1.y + mV2.y) * 0.5   M2 = (mV1.z + mV2.z) * 0.5   Gl.glBegin(Gl.GL_POINTS)   Gl.glVertex3f(M, M1, M2)   Gl.glVertex3dv(mV1.x)   Gl.glEnd()   Gl.glBegin(Gl.GL_POINTS)   Gl.glColor3f(1.0F, 0.0F, 1.0F)   Gl.glVertex3dv(mV2.x)   Gl.glEnd()   ;  Thanks everybody.   