Example #1
0
        public static SCNPlane CreatePlane(CGSize size, NSObject contents)
        {
            var plane = SCNPlane.Create(size.Width, size.Height);

            plane.InsertMaterial(SCNMaterialExtensions.CreateMaterial(contents), 0);
            return(plane);
        }
Example #2
0
        public static SCNPlane CreateSquarePlane(float size, NSObject contents)
        {
            var plane = SCNPlane.Create(size, size);

            plane.InsertMaterial(SCNMaterialExtensions.CreateMaterial(contents), 0);
            return(plane);
        }
Example #3
0
        public static SCNNode CreateAxesNode(float quiverLength, float quiverThickness)
        {
            quiverThickness = (quiverLength / 50f) * quiverThickness;
            var chamferRadius = quiverThickness / 2f;

            var xQuiverBox = SCNBox.Create(quiverLength, quiverThickness, quiverThickness, chamferRadius);

            xQuiverBox.InsertMaterial(SCNMaterialExtensions.CreateMaterial(UIColor.Red, false), 0);
            var xQuiverNode = SCNNode.FromGeometry(xQuiverBox);

            xQuiverNode.Position = new SCNVector3((quiverLength / 2f), 0, 0);

            var yQuiverBox = SCNBox.Create(quiverThickness, quiverLength, quiverThickness, chamferRadius);

            yQuiverBox.InsertMaterial(SCNMaterialExtensions.CreateMaterial(UIColor.Green, false), 0);
            var yQuiverNode = SCNNode.FromGeometry(yQuiverBox);

            yQuiverNode.Position = new SCNVector3(0, (quiverLength / 2f), 0);

            var zQuiverBox = SCNBox.Create(quiverThickness, quiverThickness, quiverLength, chamferRadius);

            zQuiverBox.InsertMaterial(SCNMaterialExtensions.CreateMaterial(UIColor.Blue, false), 0);
            var zQuiverNode = SCNNode.FromGeometry(zQuiverBox);

            zQuiverNode.Position = new SCNVector3(0, 0, (quiverLength / 2f));

            // Assemble node
            var quiverNode = new SCNNode()
            {
                Name = "Axes"
            };

            quiverNode.AddChildNode(xQuiverNode);
            quiverNode.AddChildNode(yQuiverNode);
            quiverNode.AddChildNode(zQuiverNode);

            // Return results
            return(quiverNode);
        }