public static SbVec3f[] ToArrayOfVec3F(this IList<Point> points) { var vec = new SbVec3f[points.Count]; for (int i = 0; i < points.Count; i++) { vec[i] = points[i].ConvertToVec3F(); } return vec; }
public static SbVec3f[] ToArrayOfVec3F(this List<Color> colors) { var vec = new SbVec3f[colors.Count()]; for (int i = 0; i < colors.Count(); i++) { vec[i] = colors[i].ConvertToVec3F(); } return vec; }
public TestForm() { InitializeComponent(); //_renderArea = new SoWinRenderArea(_panelView); myViewer = new SoWinExaminerViewer(this, "", true, SoWinFullViewer.BuildFlags.BUILD_ALL, SoWinViewer.Types.BROWSER); _root = new SoSeparator(); _scene = GetSceneSettings(); _sceneCenter = new SbVec3f(_scene.BoundaryBox.Length/2, _scene.BoundaryBox.Width/2, _scene.BoundaryBox.Height/2); _radius = new[] {_scene.BoundaryBox.Length, _scene.BoundaryBox.Width, _scene.BoundaryBox.Height}.Max()*2; CreateCamera(); CreateLights(); _testHelper = new TestHelper(this); _testHelper.CreateScene(); }
private static SbVec3f GetCameraPosition(float angle, float radius, SbVec3f sceneCenter) { return new SbVec3f((float) (radius*Math.Cos(angle) + sceneCenter.X), sceneCenter.Y, (float) (radius*Math.Sin(angle) + sceneCenter.Z)); }
private void SetupCamera(float radius, SbVec3f sceneCenter) { _camera.position.Value = GetCameraPosition(0, radius, sceneCenter); _camera.PointAt(sceneCenter); }