public FormWell()
        {
            this.camera  = new ScientificCamera(CameraTypes.Perspecitive);
            this.rotator = new SatelliteRotation(camera);

            InitializeComponent();

            this.openGLControl.MouseWheel += openGLControl_MouseWheel;
        }
Beispiel #2
0
        private void FormPointSpriteStringElement_Load(object sender, EventArgs e)
        {
            this.camera  = new ScientificCamera(CameraTypes.Perspecitive);
            this.rotator = new SatelliteRotation(this.camera);

            //this.fontElement = new PointSpriteStringElement(this.camera, "A", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            this.fontElement = new PointSpriteStringElement(
                this.camera, "AAAAAAAAAAAAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "hi text!", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            //this.fontElement = new PointSpriteStringElement(this.camera, "qwertyuiop[]", new SharpGL.SceneGraph.Vertex(0, 0, 0));
            this.fontElement.Initialize(this.openGLControl.OpenGL);
        }
        private void InitializeSceneControl()
        {
            var root = this.mySceneControl.Scene.SceneContainer;

            root.Children.Clear();
            root.Effects.Clear();
            //InitializeSceneAttributes(root);
            this.modelContainer = new ModelContainer();
            this.modelContainer.RenderBoundingBox = false;
            root.AddChild(this.modelContainer);

            {
                var model = new ScientificModel(100 * 100 * 100, BeginMode.Points);
                model.Build(new Vertex(-5, -5, -5), new Vertex(5, 5, 5));
                ScientificModelElement element = new ScientificModelElement(
                    model, this.mySceneControl.Scene.CurrentCamera);
                this.modelContainer.AddChild(element);
                this.modelContainer.BoundingBox.Extend(model.BoundingBox.MaxPosition);
                this.modelContainer.BoundingBox.Extend(model.BoundingBox.MinPosition);
            }

            // Diff: MySceneControl don't need this.
            //var camera = new ScientificCamera()
            //{
            //    Position = new Vertex(-10f, -10f, 10f),
            //    Target = new Vertex(0f, 0f, 0f),
            //    UpVector = new Vertex(0f, 0f, 1f)
            //};
            //this.sceneControl.Scene.CurrentCamera = camera;

            this.cameraRotation        = new SatelliteRotation();
            this.cameraRotation.Camera = this.mySceneControl.Scene.CurrentCamera as ScientificCamera;

            this.mySceneControl.MouseDown  += ScientificVisual3DControl_MouseDown;
            this.mySceneControl.MouseMove  += ScientificVisual3DControl_MouseMove;
            this.mySceneControl.MouseUp    += ScientificVisual3DControl_MouseUp;
            this.mySceneControl.MouseWheel += ScientificVisual3DControl_MouseWheel;
            this.mySceneControl.Resized    += ScientificVisual3DControl_Resized;
        }