Procházet zdrojové kódy

Fixed install GPU package

GLScene před 3 roky
rodič
revize
1e75331306

+ 1 - 1
AdvDemos/GLSViewer/Source/fGLForm.dfm

@@ -3,7 +3,7 @@ object GLForm: TGLForm
   Top = 227
   HelpContext = 1
   ClientHeight = 304
-  ClientWidth = 2988
+  ClientWidth = 3610
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText

+ 31 - 28
AdvDemos/GLSViewer/Source/fMain.dfm

@@ -1,10 +1,9 @@
 object MainForm: TMainForm
   Left = 188
   Top = 87
-  AutoSize = True
   Caption = 'GLSViewer'
-  ClientHeight = 433
-  ClientWidth = 622
+  ClientHeight = 553
+  ClientWidth = 769
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -134,8 +133,8 @@ object MainForm: TMainForm
   TextHeight = 16
   object StatusBar: TStatusBar
     Left = 0
-    Top = 409
-    Width = 622
+    Top = 529
+    Width = 769
     Height = 24
     Margins.Left = 4
     Margins.Top = 4
@@ -162,8 +161,8 @@ object MainForm: TMainForm
   object snViewer: TGLSceneViewer
     Left = 0
     Top = 69
-    Width = 622
-    Height = 340
+    Width = 769
+    Height = 460
     Margins.Left = 4
     Margins.Top = 4
     Margins.Right = 4
@@ -174,7 +173,7 @@ object MainForm: TMainForm
     Buffer.BackgroundColor = clGray
     Buffer.ContextOptions = [roDoubleBuffer, roRenderToWindow, roTwoSideLighting]
     Buffer.FaceCulling = False
-    FieldOfView = 147.220916748046900000
+    FieldOfView = 155.470458984375000000
     PenAsTouch = False
     OnMouseLeave = snViewerMouseLeave
     Align = alClient
@@ -185,7 +184,7 @@ object MainForm: TMainForm
   object ControlBar: TControlBar
     Left = 0
     Top = 32
-    Width = 622
+    Width = 769
     Height = 37
     Margins.Left = 4
     Margins.Top = 4
@@ -272,7 +271,7 @@ object MainForm: TMainForm
   object amMenuBar: TActionMainMenuBar
     Left = 0
     Top = 0
-    Width = 622
+    Width = 769
     Height = 32
     Margins.Left = 4
     Margins.Top = 4
@@ -967,6 +966,16 @@ object MainForm: TMainForm
   object Scene: TGLScene
     Left = 24
     Top = 96
+    object grdXYZ: TGLXYZGrid
+      XSamplingScale.Min = -10.000000000000000000
+      XSamplingScale.Max = 10.000000000000000000
+      XSamplingScale.Step = 1.000000000000000000
+      YSamplingScale.Step = 0.100000001490116100
+      ZSamplingScale.Min = -10.000000000000000000
+      ZSamplingScale.Max = 10.000000000000000000
+      ZSamplingScale.Step = 1.000000000000000000
+      Parts = [gpX, gpZ]
+    end
     object CubeExtents: TGLCube
       Material.BackProperties.Ambient.Color = {0000000000000000000000000000803F}
       Material.BackProperties.Diffuse.Color = {0C026B3F0C026B3F0000803F0000803F}
@@ -1013,16 +1022,6 @@ object MainForm: TMainForm
         NoZWrite = False
         Static = False
       end
-      object grdXYZ: TGLXYZGrid
-        XSamplingScale.Min = -10.000000000000000000
-        XSamplingScale.Max = 10.000000000000000000
-        XSamplingScale.Step = 1.000000000000000000
-        YSamplingScale.Step = 0.100000001490116100
-        ZSamplingScale.Min = -10.000000000000000000
-        ZSamplingScale.Max = 10.000000000000000000
-        ZSamplingScale.Step = 1.000000000000000000
-        Parts = [gpX, gpZ]
-      end
     end
   end
   object MaterialLib: TGLMaterialLibrary
@@ -1743,17 +1742,21 @@ object MainForm: TMainForm
             ImageIndex = 5
             ShowCaption = False
           end
-          item
-            Action = acPoints
-            Caption = '&Points'
-            ImageIndex = 21
-            ShowCaption = False
-          end
           item
             Action = acToolsNaviCube
             Caption = '&Navi Cube'
             ImageIndex = 20
             ShowCaption = False
+          end
+          item
+            Action = acPoints
+            Caption = 'Po&ints'
+            ImageIndex = 21
+          end
+          item
+            Action = acPoints
+            Caption = '&Points'
+            ImageIndex = 21
           end>
         ActionBar = atbView
       end
@@ -1779,8 +1782,8 @@ object MainForm: TMainForm
         ActionBar = atbFile
       end>
     Images = ImageListMenu
-    Left = 552
-    Top = 88
+    Left = 577
+    Top = 116
     StyleName = 'Platform Default'
     object acOptimizeMesh: TAction
       Category = 'Processing'

+ 4 - 4
AdvDemos/GLSViewer/Source/fMain.pas

@@ -966,7 +966,7 @@ var
   X, Y, Z: Single;
 
 begin
-  NumPoints := 100000;
+  NumPoints := 10000;
   GLPoints := TGLPoints(dcWorld.AddNewChild(TGLPoints));
   GLPoints.Size := 5.0;
   GLPoints.Style := psSmooth;
@@ -976,9 +976,9 @@ begin
     Color.Y := Random();
     Color.Z := Random();
 
-    X := Random(100) - 50;
-    Y := Random(100) - 50;
-    Z := Random(100) - 50;
+    X := Random(10) - 5;
+    Y := Random(10) - 5;
+    Z := Random(10) - 5;
 
     GLPoints.Positions.Add(X * 0.05, Y * 0.05, Z * 0.05);
     // Fill array of GLPoints

+ 9 - 0
Demos/interface/Pick/fPickD.dfm

@@ -12,6 +12,7 @@ object Form1: TForm1
   Font.Name = 'MS Sans Serif'
   Font.Style = []
   Position = poScreenCenter
+  OnCreate = FormCreate
   PixelsPerInch = 120
   TextHeight = 16
   object GLSceneViewer1: TGLSceneViewer
@@ -24,6 +25,7 @@ object Form1: TForm1
     Margins.Right = 4
     Margins.Bottom = 4
     Camera = GLCamera1
+    Buffer.BackgroundColor = clBackground
     FieldOfView = 152.966857910156300000
     PenAsTouch = False
     Align = alClient
@@ -75,5 +77,12 @@ object Form1: TForm1
       BottomRadius = 1.000000000000000000
       Height = 1.500000000000000000
     end
+    object Points: TGLPoints
+      Position.Coordinates = {000000000000803F000000000000803F}
+      NoZWrite = False
+      Static = False
+      Size = 5.000000000000000000
+      PointParameters.Enabled = True
+    end
   end
 end

+ 42 - 5
Demos/interface/Pick/fPickD.pas

@@ -8,16 +8,17 @@ uses
   Vcl.Controls,
   Vcl.Dialogs,
   Vcl.Forms,
-  
+
+  GLS.VectorTypes,
   GLS.Scene,
   GLS.Objects,
   GLS.Texture,
   GLS.SceneViewer,
   GLS.GeomObjects,
   GLS.Color,
- 
+
   GLS.Coordinates,
-  GLS.BaseClasses;
+  GLS.BaseClasses, GLS.SimpleNavigation;
 
 type
   TForm1 = class(TForm)
@@ -30,15 +31,17 @@ type
     Cylinder: TGLCylinder;
     Torus: TGLTorus;
     Cone: TGLCone;
+    Points: TGLPoints;
     procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
       X, Y: Integer);
     procedure GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton;
       Shift: TShiftState; X, Y: Integer);
+    procedure FormCreate(Sender: TObject);
   private
-     
+    Color: TVector3f;
     oldPick: TGLCustomSceneObject;
   public
-     
+
   end;
 
 var
@@ -48,6 +51,33 @@ implementation
 
 {$R *.DFM}
 
+
+procedure TForm1.FormCreate(Sender: TObject);
+var
+  I: Integer;
+  NumPoints: Integer;
+  X, Y, Z: Single;
+
+begin
+  NumPoints := 10000;
+  Points.Size := 5.0;
+  Points.Style := psSmooth;
+  for I := 0 to NumPoints - 1 do
+  begin
+    // add positions of Points
+    X := Random(20) - 10;
+    Y := Random(20) - 10;
+    Z := Random(20) - 10;
+    Points.Positions.Add(X * 0.05, Y * 0.05, Z * 0.05);
+    // add colors of Points
+    Color.X := Random();
+    Color.Y := Random();
+    Color.Z := Random();
+    Points.Colors.AddPoint(Color);
+  end;
+end;
+
+
 procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
   X, Y: Integer);
 var
@@ -67,6 +97,7 @@ begin
     // ...and don't forget it !
     oldPick := pickedObject;
   end;
+
 end;
 
 procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton;
@@ -80,6 +111,12 @@ begin
   begin
     // ...turn it to yellow and show its name
     pickedObject.Material.FrontProperties.Emission.Color := clrYellow;
+    if (pickedObject is TGLPoints) then
+    begin
+      Points.Colors.Clear;
+      Points.Colors.Add(1,1,0,1);
+    end;
+
     ShowMessage('You clicked the ' + pickedObject.Name);
   end;
 end;

+ 1 - 1
Packages/GLScene_GPU_DT.dpk

@@ -36,7 +36,7 @@ requires
   vcl,
   VclSmp,
   GLScene_DT,
-  GLScene_Parallel_RT;
+  GLScene_GPU_RT;
 
 contains
   CUDA.PropEditors in '..\Source\CUDA.PropEditors.pas',

+ 3 - 3
Packages/GLScene_GPU_DT.dproj

@@ -70,7 +70,7 @@
         <DCC_ImageBase>00400000</DCC_ImageBase>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Base_Win32)'!=''">
-        <DCC_UsePackage>rtl;vcl;GLScene_Parallel_RT;VclSmp;GLScene_RT;$(DCC_UsePackage)</DCC_UsePackage>
+        <DCC_UsePackage>rtl;vcl;GLScene_Parallel_RT;VclSmp;GLScene_RT;GLScene_GPU_RT;$(DCC_UsePackage)</DCC_UsePackage>
         <DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
         <DCC_DcuOutput>..\lib\$(Platform)</DCC_DcuOutput>
         <DCC_BpiOutput>..\lib\$(Platform)</DCC_BpiOutput>
@@ -80,7 +80,7 @@
     <PropertyGroup Condition="'$(Base_Win64)'!=''">
         <DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
         <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
-        <DCC_UsePackage>rtl;vcl;GLScene_Parallel_RT;VclSmp;$(DCC_UsePackage)</DCC_UsePackage>
+        <DCC_UsePackage>rtl;vcl;GLScene_Parallel_RT;VclSmp;GLScene_GPU_RT;$(DCC_UsePackage)</DCC_UsePackage>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Cfg_1)'!=''">
         <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
@@ -118,7 +118,7 @@
         <DCCReference Include="vcl.dcp"/>
         <DCCReference Include="VclSmp.dcp"/>
         <DCCReference Include="GLScene_DT.dcp"/>
-        <DCCReference Include="GLScene_Parallel_RT.dcp"/>
+        <DCCReference Include="GLScene_GPU_RT.dcp"/>
         <DCCReference Include="..\Source\CUDA.PropEditors.pas"/>
         <DCCReference Include="..\Source\CUDA.Register.pas"/>
         <DCCReference Include="..\Source\CUDA.EditorFm.pas"/>

+ 5 - 5
Packages/GLScene_GPU_RT.dproj

@@ -8,7 +8,7 @@
         <AppType>Package</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.3</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>
@@ -182,14 +182,14 @@
                 <Platform value="Win64">True</Platform>
             </Platforms>
             <Deployment Version="3">
-                <DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\Win64\GLScene_GPU_RT.bpl" Configuration="Debug" Class="ProjectOutput">
-                    <Platform Name="Win64">
+                <DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\GLScene_GPU_RT.bpl" Configuration="Debug" Class="ProjectOutput">
+                    <Platform Name="Win32">
                         <RemoteName>GLScene_GPU_RT.bpl</RemoteName>
                         <Overwrite>true</Overwrite>
                     </Platform>
                 </DeployFile>
-                <DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\GLScene_GPU_RT.bpl" Configuration="Debug" Class="ProjectOutput">
-                    <Platform Name="Win32">
+                <DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\Win64\GLScene_GPU_RT.bpl" Configuration="Debug" Class="ProjectOutput">
+                    <Platform Name="Win64">
                         <RemoteName>GLScene_GPU_RT.bpl</RemoteName>
                         <Overwrite>true</Overwrite>
                     </Platform>