| 51 |
m_camera.NearPlaneDistance = 0.01; |
m_camera.NearPlaneDistance = 0.01; |
| 52 |
m_viewport.Camera = m_camera; |
m_viewport.Camera = m_camera; |
| 53 |
|
|
| 54 |
// Setup Trackball |
// Setup Camera Control |
|
|
|
| 55 |
m_cameracontrol = new CameraControl(m_camera); |
m_cameracontrol = new CameraControl(m_camera); |
| 56 |
m_camera.Transform = m_cameracontrol.Transform; |
// m_camera.Transform = m_cameracontrol.Transform; |
| 57 |
m_cameracontrol.EventSource = m_viewport; |
m_cameracontrol.EventSource = m_viewport; |
| 58 |
|
|
| 59 |
|
|
| 270 |
Random x = new Random(); |
Random x = new Random(); |
| 271 |
Color col = colAry[x.Next(0, 5)]; |
Color col = colAry[x.Next(0, 5)]; |
| 272 |
|
|
| 273 |
|
if (data.Textures != null && |
| 274 |
|
data.Textures.FaceTextures != null && |
| 275 |
|
data.Textures.FaceTextures.Length > 0) |
| 276 |
|
{ |
| 277 |
|
col = Color.FromScRgb(data.Textures.DefaultTexture.RGBA.A, |
| 278 |
|
data.Textures.DefaultTexture.RGBA.R, |
| 279 |
|
data.Textures.DefaultTexture.RGBA.G, |
| 280 |
|
data.Textures.DefaultTexture.RGBA.B); |
| 281 |
|
} |
| 282 |
|
|
| 283 |
triangleModel = new GeometryModel3D( |
triangleModel = new GeometryModel3D( |
| 284 |
mesh, new DiffuseMaterial(new SolidColorBrush(col))); |
mesh, new DiffuseMaterial(new SolidColorBrush(col))); |
| 285 |
|
|
| 294 |
ModelVisual3D model = new ModelVisual3D(); |
ModelVisual3D model = new ModelVisual3D(); |
| 295 |
model.Content = triangleModel; |
model.Content = triangleModel; |
| 296 |
|
|
|
model.Transform = new TranslateTransform3D(0,0,0); |
|
| 297 |
return model; |
return model; |
| 298 |
} |
} |
| 299 |
|
|