예제 #1
0
        X3DTransform CreateSmoothCubePanel(IWebSceneProps websceneProps)
        {
            X3DTransform panel = CreateSmoothCubeTransForm(new Vector3(), new Vector3(0.4, 0.4, 0.02));

            panel.Shape.Url = websceneProps.Url;
            panel.Shape.Appearance.ImageTexture.Url = websceneProps.ImageUrl;
            return(panel);
        }
예제 #2
0
        void AddSmoothCubeWebSite(IWebSceneProps websceneProps, int counter, double angle, double radius, X3DTransform group)
        {
            string       name     = websceneProps.Name;
            string       url      = websceneProps.Url;
            string       imageUrl = websceneProps.ImageUrl;
            Target       t        = websceneProps.Target;
            int          visitors = websceneProps.Visitors;
            double       tangle   = angle + counter * Calc.ToRadians(40);
            double       x        = Math.Sin(tangle) * radius;
            double       y        = Math.Cos(tangle) * radius;
            Vector3      pos      = new Vector3(x, 1, y);
            X3DTransform cubeT    = null;

            cubeT              = X3DTransform.AddTransFormWithShape(ShapeType.Prefab, pos, null, new Vector3(0.2, 0.2, 0.03));
            cubeT.Shape.Name   = "smoothcube2";
            cubeT.Shape.Group  = "primitives";
            cubeT.Shape.Url    = url;
            cubeT.Shape.Target = t;
            cubeT.Shape.Appearance.Material.DEF           = "Material" + name;
            cubeT.Shape.Appearance.Material.DiffuseColor  = Vector3.One();
            cubeT.Shape.Appearance.ImageTexture.Url       = imageUrl;
            cubeT.Shape.Appearance.Movement.Rotate        = new Vector3(0.03, 1.2, 0);
            cubeT.Shape.Appearance.Movement.ApplyToParent = false;
            //transform5.Shape.Appearance.Movement.Center = "0.001 0 0";
            //           transform5.Shape.FaceCamera = FaceCamera.face_lock_y;
            group.AddChild(cubeT);
            Vector3      postxt = new Vector3(x, 0.7, y);
            X3DTransform textT  = X3DTransform.AddTransFormWithShape(ShapeType.Text, postxt, null, new Vector3(0.03, 0.03, 0.03));

            textT.Shape.Url    = url;
            textT.Shape.Target = t;
            textT.Shape.Text   = "\"" + name + "\"";
            if (visitors > 0)
            {
                string txt = visitors == 1 ? "(1 visitor)" : string.Format("({0} visitors)", visitors);
                textT.Shape.Text += "\"" + txt + "\"";
            }
            textT.Shape.Appearance.Material.USE          = "Material" + name;
            textT.Shape.Appearance.Material.DiffuseColor = new Vector3(0.1, 0.35, 0.46);
            group.AddChild(textT);
        }
예제 #3
0
        X3DTransform CreateBusinesWebsite(IWebSceneProps websceneProps,
                                          WebPanelLayout webPanelLayout
                                          )
        {
            X3DTransform t              = new X3DTransform();
            X3DTransform panel          = CreateSmoothCubePanel(websceneProps);
            var          panelZposition = 0.025f;

            t.AddChild(panel);
            panel.Scale = new Vector3(0.4f, 0.4f, 0.02f);
            if (websceneProps.Favorite >= 0)
            {
                panel.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                panel.Shape.History = websceneProps.History;
            }
            //backPanel//new Vector3(f, f, f)
            X3DTransform panelBorder = CreateSmoothCubeTransForm(new Vector3(0, 0, panelZposition), new Vector3(0.44, 0.44, 0.02));

            t.AddChild(panelBorder);
            panelBorder.Shape.Appearance.Material = webPanelLayout.TopPanelBackGround;
            if (websceneProps.Favorite >= 0)
            {
                panelBorder.Shape.Favorite = websceneProps.Favorite;
            }
            //bottomPanel
            X3DTransform bottomPanel = CreateSmoothCubeTransForm(new Vector3(0, -0.605, panelZposition), new Vector3(0.44, 0.16, 0.02));

            t.AddChild(bottomPanel);
            bottomPanel.Shape.Appearance.Material = webPanelLayout.BottomPanelBackGround;
            bottomPanel.Shape.Url    = websceneProps.Url;
            bottomPanel.Shape.Target = websceneProps.Target;
            if (websceneProps.Favorite >= 0)
            {
                bottomPanel.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                bottomPanel.Shape.History = websceneProps.History;
            }
            //bottomFrontPanel
            X3DTransform bottomFrontPanel = CreateSmoothCubeTransForm(new Vector3(0, -0.605, panelZposition), new Vector3(0.4, 0.147, 0.02));

            t.AddChild(bottomFrontPanel);
            bottomFrontPanel.Shape.Appearance.Material = webPanelLayout.BottomPanelForground;
            bottomFrontPanel.Shape.Url    = websceneProps.Url;
            bottomFrontPanel.Shape.Target = websceneProps.Target;
            if (websceneProps.Favorite >= 0)
            {
                bottomFrontPanel.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                bottomFrontPanel.Shape.History = websceneProps.History;
            }
            //text
            X3DTransform bottomText = X3DTransform.AddTransFormWithShape(ShapeType.Text, new Vector3(0, -0.584, 0), null, new Vector3(0.03, 0.03, 0.03));

            bottomText.Name = "txt";
            bottomText.Shape.Appearance.Material = webPanelLayout.BottomPanelText;
            bottomText.Shape.Url        = websceneProps.Url;
            bottomText.Shape.Target     = websceneProps.Target;
            bottomText.Shape.Text       = "\"" + websceneProps.Name + "\"";
            bottomText.Shape.RectLength = 29;
            if (websceneProps.Favorite >= 0)
            {
                bottomText.Shape.Favorite = websceneProps.Favorite;
            }
            if (websceneProps.History >= 0)
            {
                bottomText.Shape.History = websceneProps.History;
            }
            if (websceneProps.Visitors > 0)
            {
                string txt = websceneProps.Visitors == 1 ? "(1 visitor)" : string.Format("({0} visitors)", websceneProps.Visitors);
                bottomText.Shape.Text += "\"" + txt + "\"";
            }
            t.AddChild(bottomText);

            return(t);
        }