|
135 | 135 | _targetPositionCamera = new TargetPositionCamera() |
136 | 136 | { |
137 | 137 | Heading = 30, |
138 | | - Attitude = -40, |
139 | | - Distance = 300, |
| 138 | + Attitude = -30, |
| 139 | + Distance = 400, |
140 | 140 | TargetPosition = new Vector3(0, 0, 0), |
141 | 141 | ShowCameraLight = ShowCameraLightType.Auto, |
142 | 142 | }; |
|
159 | 159 |
|
160 | 160 | scene.SetAmbientLight(0.2f); |
161 | 161 |
|
162 | | - |
163 | 162 | float hashModelSize = 100; |
164 | 163 | float hashModelBarThickness = 16; |
165 | 164 | float hashModelBarOffset = 20; |
166 | 165 |
|
167 | 166 | var hashSymbolMesh = MeshFactory.CreateHashSymbolMesh(centerPosition: new Vector3(0, hashModelBarThickness * 0.5f, 0), |
168 | | - shapeYVector: new Vector3(0, 0, 1), |
169 | | - extrudeVector: new Vector3(0, hashModelBarThickness, 0), |
170 | | - size: hashModelSize, |
171 | | - barThickness: hashModelBarThickness, |
172 | | - barOffset: hashModelBarOffset, |
173 | | - name: "HashSymbolMesh"); |
| 167 | + shapeYVector: new Vector3(0, 0, 1), |
| 168 | + extrudeVector: new Vector3(0, hashModelBarThickness, 0), |
| 169 | + size: hashModelSize, |
| 170 | + barThickness: hashModelBarThickness, |
| 171 | + barOffset: hashModelBarOffset, |
| 172 | + name: "HashSymbolMesh"); |
174 | 173 |
|
175 | 174 | _hashMaterial = new StandardMaterial(diffuseColor: Color3.FromByteRgb(255, 197, 0)); |
176 | 175 | //_hashMaterial = new StandardMaterial(diffuseColor: Colors.Silver); |
|
198 | 197 | MajorLinesFrequency = 5, |
199 | 198 |
|
200 | 199 | IsClosed = true, |
201 | | - }; |
| 200 | + }; |
202 | 201 | scene.RootNode.Add(wireGridNode); |
203 | 202 |
|
204 | 203 |
|
|
209 | 208 | scene.RootNode.Add(sphereModelNode1); |
210 | 209 | } |
211 | 210 |
|
| 211 | + |
| 212 | + if (sharpEngineSceneView.IsInitialized) |
| 213 | + AddTexturePlane(); |
| 214 | + else |
| 215 | + sharpEngineSceneView.SceneViewInitialized += (sender, args) => AddTexturePlane(); |
| 216 | + |
| 217 | + |
212 | 218 | ShowInfoMessage("Initial 3D scene shown"); |
213 | 219 | } |
214 | 220 |
|
| 221 | + private void AddTexturePlane() |
| 222 | + { |
| 223 | + var gpuDevice = sharpEngineSceneView.Scene.GpuDevice; |
| 224 | + if (gpuDevice == null) |
| 225 | + return; |
| 226 | + |
| 227 | + Ab4d.SharpEngine.Utilities.TextureLoader.CreateTexture("ab4d-logo-256.png", gpuDevice, gpuImage => |
| 228 | + { |
| 229 | + var textureMaterial = new StandardMaterial(gpuImage) |
| 230 | + { |
| 231 | + HasTransparency = true, |
| 232 | + }; |
| 233 | + |
| 234 | + var planeModelNode = new PlaneModelNode(centerPosition: new Vector3(0, 30, -150), |
| 235 | + size: new Vector2(60, 60), |
| 236 | + normal: new Vector3(0, 0, 1), |
| 237 | + heightDirection: new Vector3(0, 1, 0), |
| 238 | + name: "TexturePlane") |
| 239 | + { |
| 240 | + IsHitTestVisible = false, |
| 241 | + Material = textureMaterial, |
| 242 | + BackMaterial = textureMaterial, |
| 243 | + }; |
| 244 | + |
| 245 | + sharpEngineSceneView.Scene.RootNode.Add(planeModelNode); |
| 246 | + }); |
| 247 | + } |
| 248 | + |
215 | 249 | private void UpdateRenderTime() |
216 | 250 | { |
217 | 251 | var statistics = sharpEngineSceneView.SceneView.Statistics; |
|
0 commit comments