Irrlicht function conversion to BMax

BlitzMax Forums/BlitzMax Programming/Irrlicht function conversion to BMax

verfum(Posted 2007) [#1]
Hi, would you say this is on the right track for converting this c++ Irrlicht function?

c++
void DebugShowGeometryCollision (const NewtonBody* body, int vertexCount, const dFloat* faceVertec, int id)
{
	int i;

	i = vertexCount - 1;
	dVector p0 (faceVertec[i * 3 + 0], faceVertec[i * 3 + 1], faceVertec[i * 3 + 2]);
	for (i = 0; i < vertexCount; i ++) {
		dVector p1 (faceVertec[i * 3 + 0], faceVertec[i * 3 + 1], faceVertec[i * 3 + 2]);
		glVertex3f (p0.m_x, p0.m_y, p0.m_z);
		glVertex3f (p1.m_x, p1.m_y, p1.m_z);
 		p0 = p1;
	}
}

Blitzmax
Function DebugShowGeometryCollision( body:Byte Ptr, vertexCount:Int, faceVertec:Float[], id:Int )
	Local i:Int
	Local p0:Float[0.0, 0.0, 0.0]
	Local p1:Float[0.0, 0.0, 0.0]
	Local Verticies:S3DVertex[2]
	
	p0[0]=faceVertec:Int[i:Int *3 +0]	'x 
	p0[1]=faceVertec:Int[i:Int *3 +1] 	'y
	p0[2]=faceVertec:Int[i:Int *3 +2]	'z

	For i:Int = 0 To vertexCount:Int	
		p1[0]=faceVertec:Int[i:Int *3 +0] 	'x
		p1[1]=faceVertec:Int[i:Int *3 +1] 	'y
		p1[2]=faceVertec:Int[i:Int *3 +2]	'z
		Vertices:S3DVertex[0] = (p0[0],p0[1],p0[2], 1,1,0,video.SColor(255,0,255,255),0,1);	
  		Vertices:S3DVertex[1] = (p1[0],p1[1],p1[2], 1,1,0,video.SColor(255,0,255,255),0,1);
‘		p0 = p1
	Next
End Function


It's not finished just need to know how I'm doing, thanks for any help.