fpvectorial: More LAS improvements, now it renders something

git-svn-id: trunk@35058 -
This commit is contained in:
sekelsenmat 2012-01-31 13:57:47 +00:00
parent 4e2a956745
commit b428a33960
2 changed files with 23 additions and 8 deletions

View File

@ -44,7 +44,7 @@ var
i: Integer;
lPoint1, lPoint2, lPoint3: TvPoint;
lEntity: TvEntity;
lPos: T3DPoint;
lPos1, lPos2, lPos3: T3DPoint;
begin
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
@ -57,7 +57,7 @@ begin
glLoadIdentity();
glTranslatef(0.0, 0.0,-6.0);
glRotatef(100, 220, 330, 0.0);
//glRotatef(100, 220, 330, 0.0);
{ glBegin(GL_QUADS);
glColor3f(0.0,1.0,0.0); // Set The Color To Green
@ -121,12 +121,13 @@ begin
lPoint3 := lEntity as TvPoint;
glBegin(GL_TRIANGLES); // Drawing Using Triangles
lPos := lPoint1.GetNormalizedPos(VecPage);
glVertex3f(lPos.X, lPos.Y, lPos.Z);
lPos := lPoint2.GetNormalizedPos(VecPage);
glVertex3f(lPos.X, lPos.Y, lPos.Z);
lPos := lPoint3.GetNormalizedPos(VecPage);
glVertex3f(lPos.X, lPos.Y, lPos.Z);
lPos1 := lPoint1.GetNormalizedPos(VecPage);
lPos2 := lPoint2.GetNormalizedPos(VecPage);
lPos3 := lPoint3.GetNormalizedPos(VecPage);
glColor3f(0.0,0.0,1.0); // Set The Color To Blue
glVertex3f(lPos1.X, lPos1.Y, lPos1.Z);
glVertex3f(lPos2.X, lPos2.Y, lPos2.Z);
glVertex3f(lPos3.X, lPos3.Y, lPos3.Z);
glEnd(); // Finished Drawing
end;

View File

@ -229,6 +229,7 @@ var
lPage: TvVectorialPage;
lRecord0: TLASPointDataRecordFormat0;
lRecord1: TLASPointDataRecordFormat1;
lFirstPoint: Boolean = True;
begin
// Clear and add the first page
AData.Clear;
@ -279,6 +280,19 @@ begin
AStream.ReadBuffer(lRecord1, SizeOf(TLASPointDataRecordFormat1));
lPage.AddPoint(lRecord1.X, lRecord1.Y, lRecord1.Z);
if lFirstPoint then
begin
// Correct the min and max
lPage.MinX := lRecord1.X;
lPage.MinY := lRecord1.Y;
lPage.MinZ := lRecord1.Z;
lPage.MaxX := lRecord1.X;
lPage.MaxY := lRecord1.Y;
lPage.MaxZ := lRecord1.Z;
lFirstPoint := False;
end;
// Correct the min and max
if lPage.MinX > lRecord1.X then lPage.MinX := lRecord1.X;
if lPage.MinY > lRecord1.Y then lPage.MinY := lRecord1.Y;