├── .gitignore ├── .gitmodules ├── Config ├── DefaultEditor.ini ├── DefaultEngine.ini ├── DefaultGame.ini ├── DefaultInput.ini ├── DefaultPixelStreaming.ini └── HoloLens │ └── HoloLensEngine.ini ├── Content ├── Third-Person.uasset ├── back.uasset ├── bevel.uasset ├── build.uasset ├── extrude.uasset ├── ground-tile.uasset ├── ground.uasset ├── ground_material.uasset ├── icomoon.uasset ├── icomoon_Font.uasset └── index.umap ├── README.md ├── Resource ├── demo.bat ├── demo.html ├── demo.md └── icomoon.ttf ├── Source ├── demo.Target.cs ├── demo │ ├── MyClass.cpp │ ├── MyClass.h │ ├── demo.Build.cs │ ├── demo.cpp │ └── demo.h └── demoEditor.Target.cs └── demo.uproject /.gitignore: -------------------------------------------------------------------------------- 1 | Saved/ 2 | Intermediate/ 3 | DerivedDataCache/ 4 | Collections/ 5 | Developers/ 6 | Script/ 7 | .vs/ 8 | demo.sln 9 | Binaries/ 10 | Build/ 11 | Plugins/SingleTon -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Plugins/PLSB"] 2 | path = Plugins/PLSB 3 | url = https://github.com/inveta/PLSB 4 | [submodule "Plugins/SingleTon"] 5 | path = Plugins/SingleTon 6 | url = https://github.com/inveta/SingleTon 7 | -------------------------------------------------------------------------------- /Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Config/DefaultEngine.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/EngineSettings.GameMapsSettings] 4 | GameDefaultMap=/Game/index.index 5 | EditorStartupMap=/Game/index.index 6 | 7 | [/Script/HardwareTargeting.HardwareTargetingSettings] 8 | TargetedHardwareClass=Desktop 9 | AppliedTargetedHardwareClass=Desktop 10 | DefaultGraphicsPerformance=Maximum 11 | AppliedDefaultGraphicsPerformance=Maximum 12 | 13 | [/Script/WindowsTargetPlatform.WindowsTargetSettings] 14 | DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 15 | 16 | [/Script/Engine.RendererSettings] 17 | r.GenerateMeshDistanceFields=True 18 | r.DynamicGlobalIlluminationMethod=1 19 | r.ReflectionMethod=1 20 | r.Shadow.Virtual.Enable=1 21 | 22 | [/Script/WorldPartitionEditor.WorldPartitionEditorSettings] 23 | CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet' 24 | 25 | [/Script/Engine.Engine] 26 | +ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/MyProject2") 27 | +ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/MyProject2") 28 | 29 | [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] 30 | bEnablePlugin=True 31 | bAllowNetworkConnection=True 32 | SecurityToken=AD5700AC4B4638AEECA7209D8E151F92 33 | bIncludeInShipping=False 34 | bAllowExternalStartInShipping=False 35 | bCompileAFSProject=False 36 | bUseCompression=False 37 | bLogFiles=False 38 | bReportStats=False 39 | ConnectionType=USBOnly 40 | bUseManualIPAddress=False 41 | ManualIPAddress= 42 | 43 | -------------------------------------------------------------------------------- /Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/EngineSettings.GeneralProjectSettings] 4 | ProjectID=FA73629F4DD5CA512E9C5994877C1131 5 | 6 | [/Script/UnrealEd.ProjectPackagingSettings] 7 | BuildConfiguration=PPBC_Shipping 8 | IncludePrerequisites=False 9 | 10 | -------------------------------------------------------------------------------- /Config/DefaultInput.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/Engine.InputSettings] 4 | bCaptureMouseOnLaunch=False 5 | DefaultViewportMouseLockMode=DoNotLock 6 | DefaultViewportMouseCaptureMode=CaptureDuringMouseDown 7 | 8 | -------------------------------------------------------------------------------- /Config/DefaultPixelStreaming.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/PixelStreaming.PixelStreamingSettings] 4 | DefaultCursorClassName=None 5 | TextEditBeamCursorClassName=None 6 | HiddenCursorClassName=None 7 | 8 | -------------------------------------------------------------------------------- /Config/HoloLens/HoloLensEngine.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/HoloLensPlatformEditor.HoloLensTargetSettings] 4 | bBuildForEmulation=False 5 | bBuildForDevice=True 6 | bUseNameForLogo=True 7 | bBuildForRetailWindowsStore=False 8 | bAutoIncrementVersion=False 9 | bShouldCreateAppInstaller=False 10 | AppInstallerInstallationURL= 11 | HoursBetweenUpdateChecks=0 12 | bEnablePIXProfiling=False 13 | TileBackgroundColor=(B=64,G=0,R=0,A=255) 14 | SplashScreenBackgroundColor=(B=64,G=0,R=0,A=255) 15 | +PerCultureResources=(CultureId="",Strings=(PackageDisplayName="",PublisherDisplayName="",PackageDescription="",ApplicationDisplayName="",ApplicationDescription=""),Images=()) 16 | TargetDeviceFamily=Windows.Holographic 17 | MinimumPlatformVersion= 18 | MaximumPlatformVersionTested=10.0.18362.0 19 | MaxTrianglesPerCubicMeter=500.000000 20 | SpatialMeshingVolumeSize=20.000000 21 | CompilerVersion=Default 22 | Windows10SDKVersion=10.0.18362.0 23 | +CapabilityList=internetClientServer 24 | +CapabilityList=privateNetworkClientServer 25 | +Uap2CapabilityList=spatialPerception 26 | bSetDefaultCapabilities=False 27 | SpatializationPlugin= 28 | ReverbPlugin= 29 | OcclusionPlugin= 30 | SoundCueCookQualityIndex=-1 31 | 32 | -------------------------------------------------------------------------------- /Content/Third-Person.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/Third-Person.uasset -------------------------------------------------------------------------------- /Content/back.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/back.uasset -------------------------------------------------------------------------------- /Content/bevel.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/bevel.uasset -------------------------------------------------------------------------------- /Content/build.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/build.uasset -------------------------------------------------------------------------------- /Content/extrude.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/extrude.uasset -------------------------------------------------------------------------------- /Content/ground-tile.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/ground-tile.uasset -------------------------------------------------------------------------------- /Content/ground.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/ground.uasset -------------------------------------------------------------------------------- /Content/ground_material.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/ground_material.uasset -------------------------------------------------------------------------------- /Content/icomoon.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/icomoon.uasset -------------------------------------------------------------------------------- /Content/icomoon_Font.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/icomoon_Font.uasset -------------------------------------------------------------------------------- /Content/index.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Content/index.umap -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 三维可视化Demo 2 | 3 | ## 下载打包后程序(releases) 4 | 5 | 1. https://github.com/inveta/demo/releases 6 | 2. 选择最新版下载zip包,解压 7 | 3. 运行bat文件,只支持Windows 8 | 4. 此时会弹出信令窗口,同时会打开网页 9 | 10 | ## 开发 11 | 12 | ``` 13 | # 下载源代码 14 | git clone https://github.com/inveta/demo.git --recurse-submodules 15 | 16 | # 添加 PLSB、singleTon、peer-stream 17 | git submodule add https://github.com/inveta/PLSB Plugins 18 | git submodule add https://github.com/inveta/SingleTon Plugins 19 | git submodule add https://github.com/inveta/peer-stream 20 | 21 | # 更新所有子模块 22 | git submodule update --remote 23 | ``` 24 | 25 | ## 注意事项 26 | 27 | - NodeJS 16 以上: https://nodejs.org/ 28 | - Windows 10 以上 29 | - 独立显卡nVidia或AMD,不能太旧 30 | - Chrome或Edge或Firefox 31 | - 如果提示没装DirectX,下载UEPrereqSetup_x64.exe并安装 32 | - 压缩包内内置了node_modules,无需再手动安装依赖 -------------------------------------------------------------------------------- /Resource/demo.bat: -------------------------------------------------------------------------------- 1 | npm run player && npm run signal -------------------------------------------------------------------------------- /Resource/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 85 | 86 | 87 | 131 | 132 | 133 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 202 | 203 | 285 | 286 | 287 | -------------------------------------------------------------------------------- /Resource/demo.md: -------------------------------------------------------------------------------- 1 | # 点线面体 2 | 3 | ## 生成 POI(点) 4 | 5 | ``` 6 | ps.emitMessage([ 7 | "spawn-POI", 8 | "location:X=0 Y=0 Z=0", // cm 9 | "icon:\uE998", // char 10 | "title:POI标题", // string 11 | "color:R=1 G=1 B=1", // 0~1 12 | "shape:2", // 0、1、2 13 | "id:poi001" 14 | ].join('\r\n')); 15 | ``` 16 | 17 | - 图标:字体图标库中的任意字符。 18 | - 标题:POI 图标旁边展示的标题文字。 19 | - 颜色:POI 点的主题颜色。 20 | - 坐标:三维空间中的 XYZ。 21 | - 形状:0 菱形,1 圆形,2 圆角方形。 22 | 23 | ## 生成三维路径(线) 24 | 25 | ``` 26 | ps.emitMessage([ 27 | "spawn-path", 28 | "points: X=0 Y=0 Z=1500; X=-1000 Y=0 Z=2000; X=0 Y=0 Z=0; X=1000 Y=0 Z=2000; X=0 Y=0 Z=1500", // cm 29 | "location: X=2500 Y=2500 Z=0", // cm 30 | "width:100", // cm 31 | "material:0", // int 32 | "color: R=0 G=0 B=0 ", // 0~1 33 | "id:path001", 34 | ].join('\r\n')); 35 | ``` 36 | 37 | - 点集:分号";"分隔的三维坐标,提供一系列点坐标,连接成一段曲线。 38 | - 位置:整体的三维坐标。 39 | - 宽度:路径线条的宽度。 40 | - 材质:选择样式编号。 41 | - 颜色:材质的自定义 RGBA 通道。 42 | 43 | ## 生成区域围栏(面) 44 | 45 | ``` 46 | ps.emitMessage([ 47 | "spawn-area", 48 | "points: X=1000 Y=0; X=-809 Y=588; X=309 Y=-951; X=309 Y=951; X=-809 Y=-588", // cm 49 | "location: X=5000 Y=5000 Z=0", // cm 50 | "height:700", // cm 51 | "material:0", // int 52 | "color: R=1 G=0 B=0 A=.5", // 0~1 53 | "id:area001", 54 | ].join('\r\n')); 55 | ``` 56 | 57 | - 点集:以分号";"分隔的水平坐标 XY,代表二维区域的每个端点。 58 | - 位置:三维空间中 XYZ 坐标。 59 | - 高度:“围栏”的高度。 60 | - 材质:选择区域轮廓的样式编号。 61 | - 颜色:高亮的颜色(RGBA 通道)。 62 | 63 | ## 生成动画特效(面) 64 | 65 | ``` 66 | ps.emitMessage([ 67 | "spawn-VFX", 68 | "location: X=7500 Y=7500 Z=0", // cm 69 | "scale:4.0", // float 70 | "texture:1", // int 71 | "period: 1.0", // s 72 | "id:vfx001", 73 | ].join('\r\n')); 74 | ``` 75 | 76 | - 动图:选择图片编号。 77 | - 位置:三维空间中 XYZ 坐标。 78 | - 尺寸:无需传参,等于图片本身的宽高(1px=1cm)。 79 | - 缩放:根据序列帧尺寸的缩放倍数。 80 | - 周期:序列帧播放一遍的时间。 81 | 82 | ## 生成模型(体) 83 | 84 | ``` 85 | ps.emitMessage([ 86 | "spawn-mesh", 87 | "location: X=9000 Y=9000 Z=0", // cm 88 | "scale:6.0", // float 89 | "mesh:0", // int 90 | "id:mesh001", 91 | ].join('\r\n')); 92 | ``` 93 | 94 | - 位置:三维空间中 XYZ 坐标。 95 | - 缩放:模型整体的缩放倍数。 96 | - 模型:选择模型编号,从 0 开始。 97 | 98 | # 文档 99 | 100 | ## 参数格式 101 | 102 | - 所有参数遵守类似字典的格式: 103 | - 由换行符"\r\n"分隔每一行。 104 | - 由于 UE 的原因,换行符必须使用"\r\n",不能用常规的"\n"。 105 | - 每行由冒号":"分隔键值对。 106 | - 键和值两端没有空白字符。 107 | 108 | ## 鼠标操作 109 | 110 | - 单击: 点击事件。 111 | - 左键拖拽:平移。 112 | - 右键拖拽:绕焦点旋转。 113 | - 中间: 更新焦点。 114 | - 滚轮: 缩放。 115 | -------------------------------------------------------------------------------- /Resource/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inveta/demo/005e87b26211d47c03947c9f19a18ed723215780/Resource/icomoon.ttf -------------------------------------------------------------------------------- /Source/demo.Target.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class demoTarget : TargetRules 7 | { 8 | public demoTarget(TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Game; 11 | DefaultBuildSettings = BuildSettingsVersion.V2; 12 | 13 | ExtraModuleNames.AddRange( new string[] { "demo" } ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Source/demo/MyClass.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "MyClass.h" 5 | 6 | MyClass::MyClass() 7 | { 8 | } 9 | 10 | MyClass::~MyClass() 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /Source/demo/MyClass.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | /** 8 | * 9 | */ 10 | class DEMO_API MyClass 11 | { 12 | public: 13 | MyClass(); 14 | ~MyClass(); 15 | }; 16 | -------------------------------------------------------------------------------- /Source/demo/demo.Build.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class demo : ModuleRules 6 | { 7 | public demo(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); 12 | 13 | PrivateDependencyModuleNames.AddRange(new string[] { }); 14 | 15 | // Uncomment if you are using Slate UI 16 | // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); 17 | 18 | // Uncomment if you are using online features 19 | // PrivateDependencyModuleNames.Add("OnlineSubsystem"); 20 | 21 | // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/demo/demo.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "demo.h" 4 | #include "Modules/ModuleManager.h" 5 | 6 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, demo, "demo" ); 7 | -------------------------------------------------------------------------------- /Source/demo/demo.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | -------------------------------------------------------------------------------- /Source/demoEditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class demoEditorTarget : TargetRules 7 | { 8 | public demoEditorTarget(TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Editor; 11 | DefaultBuildSettings = BuildSettingsVersion.V2; 12 | 13 | ExtraModuleNames.AddRange( new string[] { "demo" } ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demo.uproject: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "EngineAssociation": "5.0", 4 | "Category": "", 5 | "Description": "", 6 | "Modules": [ 7 | { 8 | "Name": "demo", 9 | "Type": "Runtime", 10 | "LoadingPhase": "Default" 11 | } 12 | ], 13 | "Plugins": [ 14 | { 15 | "Name": "Text3D", 16 | "Enabled": true 17 | }, 18 | { 19 | "Name": "PixelStreaming", 20 | "Enabled": true 21 | }, 22 | { 23 | "Name": "OpenImageDenoise", 24 | "Enabled": false 25 | }, 26 | { 27 | "Name": "ModelingToolsEditorMode", 28 | "Enabled": true 29 | }, 30 | { 31 | "Name": "PLSB", 32 | "Enabled": true 33 | } 34 | ] 35 | } --------------------------------------------------------------------------------