精华内容
下载资源
问答
  • 这是一个用引导的项目。 入门 首先,运行开发服务器: npm run dev # or yarn dev 用浏览器打开以查看结果。 您可以通过修改pages/index.js来开始编辑页面。 页面在您编辑文件时自动更新。... 可以在pages/api/hello...
  • 添加基元 Godot游戏引擎的一个简单插件 #Installation 只需将“Add Primitives”文件夹复制并粘贴到 godot plugins 文件夹中
  • npm install --save react-date-primitives 这个包还取决于react 。 请确保您也安装了那些。 用法 import * as React from 'react' ; import { CalendarMonth } from 'react-date-primitives' ; class ...
  • html-primitives 在没有画布的情况下绘制基本形状(和多边形)的一种看似有效的方法。 例子
  • dynamic_movement_primitives 一个用于在MATLAB中使用DMP的小程序包。 如果使用此代码库,请在引用相关的预印本 可在找到具有不同参数集的DMP的替代配方 有关使用各种函数的帮助,请在MATLAB help 键入 示例代码...
  • Intel的ipp图像图形处理库文件教程,内含ipp9.0库的百度云链接,需要的自己下。亲测可用。
  • cesium-primitives

    千次阅读 2018-07-03 09:58:43
    var viewer = new Cesium.Viewer('cesiumContainer'); var scene = viewer.scene...var primitives = scene.primitives; var solidWhite = Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE); /...
    
    var viewer = new Cesium.Viewer('cesiumContainer');
    var scene = viewer.scene;
    var primitives = scene.primitives;
    var solidWhite = Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE);
    // Combine instances for a rectangle, polygon, ellipse, and circle into a single primitive.
    var rectangle = Cesium.Rectangle.fromDegrees(-92.0, 20.0, -86.0, 27.0);
    var rectangleInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleGeometry({
            rectangle: rectangle,
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
            stRotation: Cesium.Math.toRadians(45)
        })
    });
    var rectangleOutlineInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleOutlineGeometry({
            rectangle: rectangle
        }),
        attributes: {
            color: solidWhite
        }
    });
    var positions = Cesium.Cartesian3.fromDegreesArray([-107.0, 27.0, -107.0, 22.0, -102.0, 23.0, -97.0, 21.0, -97.0, 25.0]);
    var polygonInstance = new Cesium.GeometryInstance({
        geometry: Cesium.PolygonGeometry.fromPositions({
            positions: positions,
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    var polygonOutlineInstance = new Cesium.GeometryInstance({
        geometry: Cesium.PolygonOutlineGeometry.fromPositions({
            positions: positions
        }),
        attributes: {
            color: solidWhite
        }
    });
    var center = Cesium.Cartesian3.fromDegrees(-80.0, 25.0);
    var semiMinorAxis = 300000.0;
    var semiMajorAxis = 500000.0;
    var rotation = Cesium.Math.toRadians(-40.0);
    var ellipseInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.EllipseGeometry({
            center: center,
            semiMinorAxis: semiMinorAxis,
            semiMajorAxis: semiMajorAxis,
            rotation: rotation,
            stRotation: Cesium.Math.toRadians(22),
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    var ellipseOutlineInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.EllipseOutlineGeometry({
            center: center,
            semiMinorAxis: semiMinorAxis,
            semiMajorAxis: semiMajorAxis,
            rotation: rotation
        }),
        attributes: {
            color: solidWhite
        }
    });
    center = Cesium.Cartesian3.fromDegrees(-72.0, 25.0);
    var radius = 250000.0;
    var circleInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.CircleGeometry({
            center: center,
            radius: radius,
            stRotation: Cesium.Math.toRadians(90),
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    var circleOutlineInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.CircleOutlineGeometry({
            center: center,
            radius: radius
        }),
        attributes: {
            color: solidWhite
        }
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: [rectangleInstance, polygonInstance, ellipseInstance, circleInstance],
        appearance: new Cesium.EllipsoidSurfaceAppearance({
            material: Cesium.Material.fromType('Stripe')
        })
    }));
    primitives.add(new Cesium.Primitive({
        geometryInstances: [rectangleOutlineInstance, polygonOutlineInstance, ellipseOutlineInstance, circleOutlineInstance],
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            translucent: false,
            renderState: {
                lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth)
            }
        })
    }));
    // Create extruded rectangle
    rectangle = Cesium.Rectangle.fromDegrees(-118.0, 38.0, -116.0, 40.0);
    var extrudedHeight = 500000.0;
    var extrudedRectangle = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleGeometry({
            rectangle: rectangle,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    var extrudedOutlineRectangle = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleOutlineGeometry({
            rectangle: rectangle,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: solidWhite
        }
    });
    // Create extruded ellipse
    center = Cesium.Cartesian3.fromDegrees(-117.0, 35.0);
    semiMinorAxis = 100000.0;
    semiMajorAxis = 200000.0;
    rotation = Cesium.Math.toRadians(90);
    var height = 100000.0;
    extrudedHeight = 200000.0;
    var extrudedEllipse = new Cesium.GeometryInstance({
        geometry: new Cesium.EllipseGeometry({
            center: center,
            semiMinorAxis: semiMinorAxis,
            semiMajorAxis: semiMajorAxis,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            height: height,
            rotation: rotation,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    var extrudedOutlineEllipse = new Cesium.GeometryInstance({
        geometry: new Cesium.EllipseOutlineGeometry({
            center: center,
            semiMinorAxis: semiMinorAxis,
            semiMajorAxis: semiMajorAxis,
            height: height,
            rotation: rotation,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: solidWhite
        }
    });
    // Create extruded polygon
    var polygonHierarchy = {
        positions: Cesium.Cartesian3.fromDegreesArray([-118.0, 30.0, -115.0, 30.0, -117.1, 31.1, -118.0, 33.0])
    };
    height = 300000.0;
    extrudedHeight = 700000.0;
    var extrudedPolygon = new Cesium.GeometryInstance({
        geometry: new Cesium.PolygonGeometry({
            polygonHierarchy: polygonHierarchy,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            extrudedHeight: extrudedHeight,
            height: height
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    var extrudedOutlinePolygon = new Cesium.GeometryInstance({
        geometry: new Cesium.PolygonOutlineGeometry({
            polygonHierarchy: polygonHierarchy,
            extrudedHeight: extrudedHeight,
            height: height
        }),
        attributes: {
            color: solidWhite
        }
    });
    // cylinder
    var length = 200000.0;
    var topRadius = 150000.0;
    var bottomRadius = 150000.0;
    var modelMatrix = Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-70.0, 45.0)),
        new Cesium.Cartesian3(0.0, 0.0, 100000.0), new Cesium.Matrix4());
    var cylinderInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.CylinderGeometry({
            length: length,
            topRadius: topRadius,
            bottomRadius: bottomRadius,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
        }),
        modelMatrix: modelMatrix,
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    var cylinderOutlineInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.CylinderOutlineGeometry({
            length: length,
            topRadius: topRadius,
            bottomRadius: bottomRadius
        }),
        modelMatrix: modelMatrix,
        attributes: {
            color: solidWhite
        }
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: [extrudedPolygon, extrudedRectangle, extrudedEllipse, cylinderInstance],
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: false,
            closed: true
        })
    }));
    primitives.add(new Cesium.Primitive({
        geometryInstances: [extrudedOutlineRectangle, extrudedOutlineEllipse, extrudedOutlinePolygon, cylinderOutlineInstance],
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            translucent: false,
            renderState: {
                lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth)
            }
        })
    }));
    // Create box and ellipsoid boxes, and use the instance's
    // modelMatrix to scale and position them.
    var dimensions = new Cesium.Cartesian3(1.0, 1.0, 1.0);
    var boxGeometry = Cesium.BoxGeometry.fromDimensions({
        vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        dimensions: dimensions
    });
    var boxOutlineGeometry = Cesium.BoxOutlineGeometry.fromDimensions({
        dimensions: dimensions
    });
    var radii = new Cesium.Cartesian3(0.5, 0.5, 1.0);
    var ellipsoidGeometry = new Cesium.EllipsoidGeometry({
        vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        radii: radii
    });
    var ellipsoidOutlineGeometry = new Cesium.EllipsoidOutlineGeometry({
        radii: radii,
        stackPartitions: 6,
        slicePartitions: 5
    });
    radius = 0.75;
    var sphereGeometry = new Cesium.SphereGeometry({
        vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        radius: radius
    });
    var sphereOutlineGeometry = new Cesium.SphereOutlineGeometry({
        radius: radius,
        stackPartitions: 6,
        slicePartitions: 5
    });
    var instances = [];
    var outlineInstances = [];
    var i;
    var boxModelMatrix, ellipsoidModelMatrix, sphereModelMatrix;
    for (i = 0; i < 5; ++i) {
        height = 100000.0 + (200000.0 * i);
        boxModelMatrix = Cesium.Matrix4.multiplyByUniformScale(Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-106.0, 45.0)), new Cesium.Cartesian3(0.0, 0.0, height), new Cesium.Matrix4()), 90000.0, new Cesium.Matrix4());
        ellipsoidModelMatrix = Cesium.Matrix4.multiplyByUniformScale(Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-102.0, 45.0)), new Cesium.Cartesian3(0.0, 0.0, height), new Cesium.Matrix4()), 90000.0, new Cesium.Matrix4());
        sphereModelMatrix = Cesium.Matrix4.multiplyByUniformScale(Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-98.0, 45.0)), new Cesium.Cartesian3(0.0, 0.0, height), new Cesium.Matrix4()), 90000.0, new Cesium.Matrix4());
        instances.push(new Cesium.GeometryInstance({
            geometry: boxGeometry,
            modelMatrix: boxModelMatrix,
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 1.0
                }))
            }
        }));
        outlineInstances.push(new Cesium.GeometryInstance({
            geometry: boxOutlineGeometry,
            modelMatrix: boxModelMatrix,
            attributes: {
                color: solidWhite
            }
        }));
        instances.push(new Cesium.GeometryInstance({
            geometry: ellipsoidGeometry,
            modelMatrix: ellipsoidModelMatrix,
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 1.0
                }))
            }
        }));
        outlineInstances.push(new Cesium.GeometryInstance({
            geometry: ellipsoidOutlineGeometry,
            modelMatrix: ellipsoidModelMatrix,
            attributes: {
                color: solidWhite
            }
        }));
        instances.push(new Cesium.GeometryInstance({
            geometry: sphereGeometry,
            modelMatrix: sphereModelMatrix,
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 1.0
                }))
            }
        }));
        outlineInstances.push(new Cesium.GeometryInstance({
            geometry: sphereOutlineGeometry,
            modelMatrix: sphereModelMatrix,
            attributes: {
                color: solidWhite
            }
        }));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: instances,
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: false,
            closed: true
        })
    }));
    primitives.add(new Cesium.Primitive({
        geometryInstances: outlineInstances,
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            translucent: false,
            renderState: {
                lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth)
            }
        })
    }));
    // Create a single wall
    positions = Cesium.Cartesian3.fromDegreesArray([-95.0, 50.0, -85.0, 50.0, -75.0, 50.0]);
    var maximumHeights = [500000, 1000000, 500000];
    var minimumHeights = [0, 500000, 0];
    var wallInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.WallGeometry({
            positions: positions,
            maximumHeights: maximumHeights,
            minimumHeights: minimumHeights,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 0.7
            }))
        }
    });
    var wallOutlineInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.WallOutlineGeometry({
            positions: positions,
            maximumHeights: maximumHeights,
            minimumHeights: minimumHeights
        }),
        attributes: {
            color: new Cesium.ColorGeometryInstanceAttribute(0.7, 0.7, 0.7, 1.0)
        }
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: wallInstance,
        appearance: new Cesium.PerInstanceColorAppearance()
    }));
    primitives.add(new Cesium.Primitive({
        geometryInstances: wallOutlineInstance,
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            translucent: false,
            renderState: {
                lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth)
            }
        })
    }));
    rectangle = Cesium.Rectangle.fromDegrees(-92.0, 30.0, -85.0, 40.0);
    rectangleInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleGeometry({
            rectangle: rectangle,
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    polygonHierarchy = {
        positions: Cesium.Cartesian3.fromDegreesArray([-109.0, 30.0, -95.0, 30.0, -95.0, 40.0, -109.0, 40.0]),
        holes: [{
            positions: Cesium.Cartesian3.fromDegreesArray([-107.0, 31.0, -107.0, 39.0, -97.0, 39.0, -97.0, 31.0]),
            holes: [{
                positions: Cesium.Cartesian3.fromDegreesArray([-105.0, 33.0, -99.0, 33.0, -99.0, 37.0, -105.0, 37.0]),
                holes: [{
                    positions: Cesium.Cartesian3.fromDegreesArray([-103.0, 34.0, -101.0, 34.0, -101.0, 36.0, -103.0, 36.0])
                }]
            }]
        }]
    };
    polygonInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.PolygonGeometry({
            polygonHierarchy: polygonHierarchy,
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    center = Cesium.Cartesian3.fromDegrees(-80.0, 35.0);
    semiMinorAxis = 200000.0;
    semiMajorAxis = 500000.0;
    rotation = Cesium.Math.toRadians(30.0);
    ellipseInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.EllipseGeometry({
            center: center,
            semiMinorAxis: semiMinorAxis,
            semiMajorAxis: semiMajorAxis,
            rotation: rotation,
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    center = Cesium.Cartesian3.fromDegrees(-72.0, 35.0);
    radius = 200000.0;
    circleInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.CircleGeometry({
            center: center,
            radius: radius,
            vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        })
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: [rectangleInstance, polygonInstance, ellipseInstance, circleInstance],
        appearance: new Cesium.EllipsoidSurfaceAppearance({
            material: Cesium.Material.fromType('Stripe')
        })
    }));
    // Create extruded rectangle
    rectangle = Cesium.Rectangle.fromDegrees(-110.0, 38.0, -107.0, 40.0);
    height = 700000.0;
    extrudedHeight = 1000000.0;
    rotation = Cesium.Math.toRadians(45.0);
    extrudedRectangle = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleGeometry({
            rectangle: rectangle,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            height: height,
            rotation: rotation,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    // Create extruded ellipse
    center = Cesium.Cartesian3.fromDegrees(-110.0, 35.0);
    semiMinorAxis = 100000.0;
    semiMajorAxis = 200000.0;
    rotation = Cesium.Math.toRadians(-40.0);
    height = 300000.0;
    extrudedHeight = 700000.0;
    extrudedEllipse = new Cesium.GeometryInstance({
        geometry: new Cesium.EllipseGeometry({
            center: center,
            semiMinorAxis: semiMinorAxis,
            semiMajorAxis: semiMajorAxis,
            rotation: rotation,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            height: height,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    // Create extruded polygon
    polygonHierarchy = {
        positions: Cesium.Cartesian3.fromDegreesArray([-113.0, 30.0, -110.0, 30.0, -110.0, 33.0, -111.5, 31.0, -113.0, 33.0])
    };
    extrudedHeight = 300000.0;
    extrudedPolygon = new Cesium.GeometryInstance({
        geometry: new Cesium.PolygonGeometry({
            polygonHierarchy: polygonHierarchy,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            extrudedHeight: extrudedHeight
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    // cylinder
    length = 400000.0;
    topRadius = 0.0;
    bottomRadius = 200000.0;
    modelMatrix = Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
        Cesium.Cartesian3.fromDegrees(-70.0, 40.0)), new Cesium.Cartesian3(0.0, 0.0, 200000.0), new Cesium.Matrix4());
    cylinderInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.CylinderGeometry({
            length: length,
            topRadius: topRadius,
            bottomRadius: bottomRadius,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
        }),
        modelMatrix: modelMatrix,
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: [extrudedPolygon, extrudedRectangle, extrudedEllipse, cylinderInstance],
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: false,
            closed: true
        })
    }));
    // Combine instances each with a unique color.
    // We can combine heterogeneous geometries as we
    // do here as long as vertex formats match.
    instances = [];
    center = Cesium.Cartesian3.fromDegrees(-65.0, 35.0);
    radius = 200000.0;
    rectangle = Cesium.Rectangle.fromDegrees(-67.0, 27.0, -63.0, 32.0);
    for (i = 0; i < 5; ++i) {
        height = 200000.0 * i;
        instances.push(new Cesium.GeometryInstance({
            geometry: new Cesium.CircleGeometry({
                center: center,
                radius: radius,
                height: height,
                vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
            }),
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 0.5
                }))
            }
        }));
        instances.push(new Cesium.GeometryInstance({
            geometry: new Cesium.RectangleGeometry({
                rectangle: rectangle,
                height: height,
                vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
            }),
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 0.5
                }))
            }
        }));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: instances,
        appearance: new Cesium.PerInstanceColorAppearance()
    }));
    // Create box and ellipsoid boxes, and use the instance's
    // modelMatrix to scale and position them.
    dimensions = new Cesium.Cartesian3(1.0, 1.0, 1.0);
    boxGeometry = Cesium.BoxGeometry.fromDimensions({
        vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        dimensions: dimensions
    });
    radii = new Cesium.Cartesian3(0.5, 0.5, 1.0);
    ellipsoidGeometry = new Cesium.EllipsoidGeometry({
        vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        radii: radii
    });
    radius = 0.75;
    sphereGeometry = new Cesium.SphereGeometry({
        vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
        radius: radius
    });
    instances = [];
    outlineInstances = [];
    for (i = 0; i < 5; ++i) {
        height = 100000.0 + (200000.0 * i);
        boxModelMatrix = Cesium.Matrix4.multiplyByUniformScale(Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-108.0, 45.0)), new Cesium.Cartesian3(0.0, 0.0, height), new Cesium.Matrix4()), 90000.0, new Cesium.Matrix4());
        ellipsoidModelMatrix = Cesium.Matrix4.multiplyByUniformScale(Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-104.0, 45.0)), new Cesium.Cartesian3(0.0, 0.0, height), new Cesium.Matrix4()), 90000.0, new Cesium.Matrix4());
        sphereModelMatrix = Cesium.Matrix4.multiplyByUniformScale(Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
            Cesium.Cartesian3.fromDegrees(-100.0, 45.0)), new Cesium.Cartesian3(0.0, 0.0, height), new Cesium.Matrix4()), 90000.0, new Cesium.Matrix4());
        instances.push(new Cesium.GeometryInstance({
            geometry: boxGeometry,
            modelMatrix: boxModelMatrix,
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 0.5
                }))
            }
        }));
        instances.push(new Cesium.GeometryInstance({
            geometry: ellipsoidGeometry,
            modelMatrix: ellipsoidModelMatrix,
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 0.5
                }))
            }
        }));
        instances.push(new Cesium.GeometryInstance({
            geometry: sphereGeometry,
            modelMatrix: sphereModelMatrix,
            attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                    alpha: 0.5
                }))
            }
        }));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: instances,
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: true,
            closed: true
        })
    }));
    positions = [];
    var colors = [];
    for (i = 0; i < 40; ++i) {
        positions.push(Cesium.Cartesian3.fromDegrees(-100.0 + i, 48.0));
        colors.push(Cesium.Color.fromRandom({
            alpha: 1.0
        }));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: new Cesium.GeometryInstance({
            geometry: new Cesium.SimplePolylineGeometry({
                positions: positions,
                colors: colors
            })
        }),
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            renderState: {
                // Override the appearance render state to change the
                // line width on system's that support it (Linx/Mac).
                lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth)
            }
        })
    }));
    // create a polyline with a material
    positions = [];
    for (i = 0; i < 40; ++i) {
        positions.push(Cesium.Cartesian3.fromDegrees(-100.0 + i, 15.0));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: new Cesium.GeometryInstance({
            geometry: new Cesium.PolylineGeometry({
                positions: positions,
                width: 10.0,
                vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
            })
        }),
        appearance: new Cesium.PolylineMaterialAppearance({
            material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType)
        })
    }));
    // create a polyline with per segment colors
    positions = [];
    colors = [];
    for (i = 0; i < 40; ++i) {
        positions.push(Cesium.Cartesian3.fromDegrees(-100.0 + i, 12.0));
        colors.push(Cesium.Color.fromRandom({
            alpha: 1.0
        }));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: new Cesium.GeometryInstance({
            geometry: new Cesium.PolylineGeometry({
                positions: positions,
                width: 10.0,
                vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT,
                colors: colors
            })
        }),
        appearance: new Cesium.PolylineColorAppearance()
    }));
    // create a polyline with per vertex colors
    positions = [];
    colors = [];
    for (i = 0; i < 40; ++i) {
        positions.push(Cesium.Cartesian3.fromDegrees(-100.0 + i, 9.0));
        colors.push(Cesium.Color.fromRandom({
            alpha: 1.0
        }));
    }
    primitives.add(new Cesium.Primitive({
        geometryInstances: new Cesium.GeometryInstance({
            geometry: new Cesium.PolylineGeometry({
                positions: positions,
                width: 10.0,
                vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT,
                colors: colors,
                colorsPerVertex: true
            })
        }),
        appearance: new Cesium.PolylineColorAppearance()
    }));
    // Create a single wall
    positions = Cesium.Cartesian3.fromDegreesArrayHeights([-90.0, 43.0, 100000.0, -87.5, 45.0, 100000.0, -85.0, 43.0, 100000.0, -87.5, 41.0, 100000.0, -90.0, 43.0, 100000.0]);
    wallInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.WallGeometry({
            positions: positions
        })
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: wallInstance,
        appearance: new Cesium.MaterialAppearance({
            material: Cesium.Material.fromType('Checkerboard', {
                repeat: new Cesium.Cartesian2(20.0, 6.0)
            })
        })
    }));
    positions = Cesium.Cartesian3.fromDegreesArray([-120.0, 45.0, -125.0, 50.0, -125.0, 55.0]);
    var width = 100000;
    var corridor = new Cesium.GeometryInstance({
        geometry: new Cesium.CorridorGeometry({
            positions: positions,
            width: width,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    var extrudedCorridor = new Cesium.GeometryInstance({
        geometry: new Cesium.CorridorGeometry({
            positions: positions,
            width: width,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            height: 300000,
            extrudedHeight: 400000
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 0.7
            }))
        }
    });
    var corridorOutline = new Cesium.GeometryInstance({
        geometry: new Cesium.CorridorOutlineGeometry({
            positions: positions,
            width: width,
            height: 700000
        }),
        attributes: {
            color: solidWhite
        }
    });
    var corridorFill = new Cesium.GeometryInstance({
        geometry: new Cesium.CorridorGeometry({
            positions: positions,
            width: width,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            height: 700000
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 0.7
            }))
        }
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: [corridor, extrudedCorridor, corridorFill],
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: true,
            closed: true
        })
    }));
    primitives.add(new Cesium.Primitive({
        geometryInstances: corridorOutline,
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            translucent: false,
            renderState: {
                lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth)
            }
        })
    }));
    
    function starPositions(arms, rOuter, rInner) {
        var angle = Math.PI / arms;
        var pos = [];
        for (var i = 0; i < 2 * arms; i++) {
            var r = (i % 2) === 0 ? rOuter : rInner;
            var p = new Cesium.Cartesian2(Math.cos(i * angle) * r, Math.sin(i * angle) * r);
            pos.push(p);
        }
        return pos;
    }
    positions = Cesium.Cartesian3.fromDegreesArrayHeights([-102.0, 15.0, 100000.0, -105.0, 20.0, 200000.0, -110.0, 20.0, 100000.0]);
    var polylineVolumeFill = new Cesium.GeometryInstance({
        geometry: new Cesium.PolylineVolumeGeometry({
            polylinePositions: positions,
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            shapePositions: starPositions(7, 30000.0, 20000.0)
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    var polylineVolumeOutline = new Cesium.GeometryInstance({
        geometry: new Cesium.PolylineVolumeOutlineGeometry({
            polylinePositions: positions,
            shapePositions: starPositions(7, 30000.0, 20000.0)
        }),
        attributes: {
            color: solidWhite
        }
    });
    var polylineVolume = new Cesium.GeometryInstance({
        geometry: new Cesium.PolylineVolumeGeometry({
            polylinePositions: Cesium.Cartesian3.fromDegreesArray([-102.0, 15.0, -105.0, 20.0, -110.0, 20.0]),
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            shapePositions: starPositions(7, 30000, 20000)
        }),
        attributes: {
            color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({
                alpha: 1.0
            }))
        }
    });
    
    function computeCircle(radius) {
        var positions = [];
        for (var i = 0; i < 360; i++) {
            var radians = Cesium.Math.toRadians(i);
            positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
        }
        return positions;
    }
    var tubeGeometry = new Cesium.GeometryInstance({
        geometry: new Cesium.PolylineVolumeGeometry({
            polylinePositions: Cesium.Cartesian3.fromDegreesArray([-104.0, 13.0, -107.0, 18.0, -112.0, 18.0]),
            vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
            shapePositions: computeCircle(40000.0)
        }),
        attributes: {
            color: solidWhite
        }
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances: [tubeGeometry, polylineVolume, polylineVolumeFill],
        appearance: new Cesium.PerInstanceColorAppearance({
            translucent: false,
            closed: true
        })
    }));
    primitives.add(new Cesium.Primitive({
        geometryInstances: polylineVolumeOutline,
        appearance: new Cesium.PerInstanceColorAppearance({
            flat: true,
            translucent: false,
            renderState: {
                lineWidth: 1.0
            }
        })
    }));

    展开全文
  • 用于Unity3D的各种形状的模型,包括棱柱体,半圆柱体,给你的游戏各种想象的空间
  • IPP 8.0(30天试用版),包含注册文件。
  • 如何使用Altera FPGA芯片的内部资源,可以实现芯片内部资源的合理分配。
  • System.ComponentModel.Primitives' could not be found' when trying to install the latest package System.ComponentModel.Primitives to .NET 4.7.1 project. Everything is fine for .NET 4.6.2 <p>Can...
  • 参考资料链接: DMP:DYNAMIC MOVEMENT PRIMITIVES. 长期以来,复杂的动作一直被认为是由一系列按顺序或并行执行的原始动作构建块组成的,而DMPs是这些原始动作的一种拟议的数学形式化。DMP与先前提出的构件的区别...

    参考资料链接: DMP:DYNAMIC MOVEMENT PRIMITIVES.
    长期以来,复杂的动作一直被认为是由一系列按顺序或并行执行的原始动作构建块组成的,而DMPs是这些原始动作的一种拟议的数学形式化。DMP与先前提出的构件的区别在于,每个DMP都是一个非线性动力学系统。基本思想是,你拿一个具有明确的,稳定行为的动力系统,加上另一个术语,使它在运行过程中,遵循一些有趣的轨迹。dmp有两种:离散型和节奏型。对于离散的运动,基本系统是一个点吸引器,而对于有节奏的运动,则使用极限环。在这篇文章中,我们只关心离散的dmp,因为当我们完成所有的基本内容时,这篇文章已经很长了。
    假设你有两个系统:一个是你规划轨迹的假想系统,另一个是你执行轨迹的实际系统。当您使用DMP时,您所做的就是为实际系统规划要遵循的轨迹。DMP有它自己的一组动态,通过正确地设置DMP,您可以获得实际系统要遵循的控制信号。如果我们的DMP系统正在为手规划路径,那么发送到实际系统的是需要施加到手上的力的集合。这取决于真正的系统,通过将这些手力转换成关节扭矩或肌肉激活(通过操作空间控制框架之类的东西)或其他东西来应用它们。这就是我在这里所要讲的关于实际系统的所有内容,这里我们要关注的是DMP系统。但请记住,整个DMP框架是用来生成轨迹控制信号来引导实际系统的。
    在github上,已经有了基本离散DMP设置的代码和我在这篇文章中使用的示例,所以如果你想直接跳到那,有链接.您可以通过执行每个类的文件来运行测试代码。

    Discrete DMPs:

    让我们从点吸引器动力学开始:
    y ¨ = α y ( β y ( g − y ) − y ˙ ) \ddot{y} = \alpha_y ( \beta_y (g - y) - \dot{y}) y¨=αy(βy(gy)y˙)
    其中y是系统的状态,g是目标, α \alpha α β \beta β是增益项。这看起来应该很熟悉,这是PD控制信号,所有这一切的作用是把我们的系统引向目标。现在我们要做的是添加一个强制项,让我们修改这个轨迹:
    y ¨ = α y ( β y ( g − y ) − y ˙ ) + f \ddot{y} = \alpha_y ( \beta_y (g - y) - \dot{y}) + f y¨=αy(βy(gy)y˙)+f
    如何定义一个非线性函数f使你得到渴望的行为是一个重要的问题。DMP框架的关键是一个附加的非线性系统,用来定义随时间变化的强迫函数f,从而为问题提供了一个定义良好的结构,可以直接解决问题,并易于推广。引入的系统称为正则动力学系统,记为 x x x,具有非常简单的动力学:
    x ˙ = − α x x \dot{x} = -\alpha_x x x˙=αxx
    强迫函数f定义为正则系统的一个函数:
    f ( x , g ) = Σ i = 1 N ψ i w i Σ i = 1 N ψ i x ( g − y 0 ) f(x,g) = \frac{\Sigma_{i=1}^N \psi_i w_i}{\Sigma_{i=1}^N \psi_i} x(g - y_0) f(x,g)=Σi=1NψiΣi=1Nψiwix(gy0)
    y 0 y_0 y0是系统的初始位置。
    ψ i = exp ( − h i ( x − c i ) 2 ) \psi_i = \textrm{exp}\left( -h_i \left( x - c_i\right)^2 \right) ψi=exp(hi(xci)2)
    w i w_i wi 是给定基函数 ψ i \psi_i ψi的权重。你可能认识到,上面的 ψ i \psi_i ψi方程定义了一个以 c i c_i ci为中心的高斯函数,其中 h i h_i hi是方差。所以我们的强迫函数是一组高斯函数当正则系统x收敛到它的目标时被激活。它们的加权总和被标准化,然后乘以 x ( g − y 0 ) x (g - y_0) x(gy0)项,这是一个“递减”和空间缩放项。
    让我们把它分解一下。正则系统从某个任意值开始,贯穿这篇文章, x 0 = 1 x_0 = 1 x0=1,并且随着时间趋于无穷而趋于0。现在,我们假设 x x x线性衰减到0。第一个要点是,有一些基函数作为 x x x的函数被激活,这显示在下面的图中。当x的值从1减少到0时,每个高斯函数都围绕不同的 x x x值被激活(或以其为中心)。第二件事是,每个基函数都有一个权重, w i w_i wi。这些权重显示在下面:
    在这里插入图片描述

    The diminishing term

    x x x项合并到强迫函数中可以保证强迫项的贡献随时间趋于零,就像正则系统所做的那样。这意味着我们可以在晚上睡得很安稳,因为我们知道我们的系统可以沿着一些疯狂的路径,不管怎样,最终都会回到它更简单的点吸引子动力学并收敛到目标上。

    Spatial scaling

    空间缩放的意思是,一旦我们建立了系统,按照一个理想的轨迹,以达到一个特定的目标,我们希望能够把这个目标移动得更远或更近,并得到我们的轨迹的缩放版本。这就是强制函数的 ( g − y 0 ) (g - y_0) (gy0)项所处理的,通过将每个基函数的激活量按比例缩放到与目标的距离,从而使系统覆盖或多或少的距离。例如,假设我们有一组离散的DMPs,按照给定的轨迹设置:
    在这里插入图片描述
    本例中的目标是1和.5,您可以看到这是dmp结束的地方。现在,我们已经为这些特定的目标(1和.5)在本例中指定了所有内容,但是现在假设我们想一般化并得到这个轨迹的一个扩展版本,以便通过DMPs移动到目标2。如果我们不适当地缩放我们的强迫函数 ( g − y 0 ) (g - y_0) (gy0)项,那么我们最终会得到这样的结果:
    在这里插入图片描述
    基本上所发生的是对于这些新目标相同权重的基函数太弱了无法让系统遵循或达到预期的轨迹。然而,一旦 ( g − y 0 ) (g - y_0) (gy0)项包含在强制函数中,我们得到:
    在这里插入图片描述

    Spreading basis function centers

    好了,不幸的是,我们的正则系统并不像我们之前假设的那样,线性地收敛于目标系统。下面是实际系统的线性衰减和指数衰减的比较:
    在这里插入图片描述
    这是一个问题,因为我们的基函数的激活依赖于 x x x。如果系统是线性的,那么我们将很好,基函数的激活将很好地分散到系统收敛到目标。但是,在实际的动力学中, x x x不是时间的线性函数。当我们把基本功能的激活作为时间的函数时,我们可以看到大多数激活都是在 x x x开始快速移动时立即被激活的,然后随着 x x x在最后变慢而延伸:
    在这里插入图片描述
    为了使基函数随时间分布得更均匀(以便我们的强迫函数在接近目标时仍能使系统沿着有趣的路径移动),我们需要更精明地选择高斯中心点。如果我们看x随时间变化的值,我们可以选择我们想要高斯函数被激活的时间,然后反向求出对应的 x x x值在那个时间点上给我们激活。所以,让我们看一张图片:
    在这里插入图片描述
    红色的点是高斯函数居中的时间,蓝色的线是标准系统 x x x。沿着虚线一直到对应的 x x x值,我们可以看到高斯函数需要居中的x值是多少。此外,我们需要稍微担心一下高斯函数的宽度,因为那些稍后被激活的函数将被激活更长的时间。为了使它均匀,后面的基函数的宽度应该更小。通过非常非分析的试错法,我计算方差为
    h i = # B F s c i h_i = \frac{\#BFs}{c_i} hi=ci#BFs
    它表示基函数 i i i的方差等于基函数的个数除以基函数的中心。当我们这样做的时候,我们现在可以为基函数生成中心它们之间间隔得很好:
    在这里插入图片描述

    Temporal scaling

    再说一次,可泛化性是我们想从这个系统中得到的非常重要的东西之一。有两种明显的类型,时间和空间。我们在上面讨论过空间缩放,在时间情况下,我们希望能够以不同的速度遵循相同的轨迹。有时快,有时慢,但总是沿着同一条路走。为了做到这一点,我们要在系统动力学中加入另一个项,时间尺度项 τ \tau τ。已知系统动力学是:
    y ¨ = α y ( β y ( g − y ) − y ˙ ) + f \ddot{y} = \alpha_y ( \beta_y (g - y) - \dot{y}) + f y¨=αy(βy(gy)y˙)+f
    x ˙ = − α x x \dot{x} = -\alpha_x x x˙=αxx
    为了给我们时间上的灵活性,我们可以添加 τ \tau τ项:
    y ˙    + = τ y ¨ , \dot{y}\; +\hspace{-1mm}= \tau \ddot{y}, y˙+=τy¨,

    y    + = τ y ˙ , y\; +\hspace{-1mm}= \tau \dot{y}, y+=τy˙,

    x    + = τ x ˙ , x\; +\hspace{-1mm}= \tau \dot{x}, x+=τx˙,
    这就是我们所要做的!为了让系统减速,你把 τ \tau τ设置在0和1之间,为了让系统加速,你把 τ \tau τ设置为大于1。

    Imitating a desired path

    好了。我们有一个强制条件,可以使系统在汇聚到目标点时采取奇怪的路径,以及时间和空间的可扩展性。我们如何设置系统来遵循我们指定的路径?这将是理想的,向系统显示路径,让它能够反向工作并计算出力,然后能够在任何我们想要的时候生成轨迹。这是一个非常直接的过程。
    我们可以控制强迫项,它影响系统加速度。因此,我们首先需要取我们想要的轨迹, y d \textbf{y}_d yd(其中粗体表示一个向量,在本例中是轨迹中想要的点的时间序列),并对它微分两次以得到加速度:
    y ¨ d = ∂ ∂ t y ˙ d = ∂ ∂ t ∂ ∂ t y d \ddot{\textbf{y}}_d = \frac{\partial}{\partial t} \dot{\textbf{y}}_d = \frac{\partial}{\partial t} \frac{\partial}{\partial t} \textbf{y}_d y¨d=ty˙d=ttyd
    一旦我们有了想要的加速轨迹,我们需要去除基点吸引器系统的影响。我们有上面的公式确切地说明了点吸引器系统在每个时间点上引起的加速度是什么:
    y ¨ = α y ( β y ( g − y ) − y ˙ ) \ddot{y} = \alpha_y ( \beta_y (g - y) - \dot{y}) y¨=αy(βy(gy)y˙)
    然后计算强迫项需要产生这个轨迹,我们有:
    f d = y ¨ d − α y ( β y ( g − y ) − y ˙ ) \textbf{f}_d = \ddot{\textbf{y}}_d - \alpha_y ( \beta_y (g - \textbf{y}) - \dot{\textbf{y}}) fd=y¨dαy(βy(gy)y˙)
    从这里我们知道强迫项由加权求和的基函数通过激活时间,所以我们可以使用一个优化技术等局部加权回归权重选择在我们的基函数,这样强制函数匹配所需的轨迹 f d \textbf {f} _d fd。在局部加权回归集合中使之最小化:
    Σ t ψ i ( t ) ( f d ( t ) − w i ( x ( t ) ( g − y 0 ) ) ) 2 \Sigma_t \psi_i(t)(f_d(t) - w_i (x(t) (g - y_0)))^2 Σtψi(t)(fd(t)wi(x(t)(gy0)))2
    解决方案是(我不会在此推导,但在Schaal 1998年的论文中进行了推导)
    w i = s T ψ i f d s T ψ i s w_i = \frac{\textbf{s}^T \pmb{\psi}_i \textbf{f}_d}{\textbf{s}^T \pmb{\psi}_i \textbf{s}} wi=sTψψψissTψψψifd
    其中:
    s = ( x t 0 ( g − y 0 ) ⋮ x t N ( g − y 0 ) ) ,        ψ i = ( ψ i ( t 0 ) … 0 0 ⋱ 0 0 … ψ i ( t n ) ) \textbf{s} = \left( \begin{array}{c}x_{t_0}(g - y_0) \\ \vdots \\ x_{t_N}(g - y_0) \end{array} \right), \;\;\; \pmb{\psi}_i = \left( \begin{array}{ccc} \psi_i(t_0) & \dots & 0 \\ 0 & \ddots & 0 \\ 0 & \dots & \psi_i(t_n) \end{array} \right) s=xt0(gy0)xtN(gy0),ψψψi=ψi(t0)0000ψi(tn)
    太棒了!现在,我们有了开始用一些基本离散DMPs所需的基本知识!

    Different numbers of basis functions

    在模仿路径时,你马上就会注意到的一件事是,随着轨迹复杂性的增加,所需的基函数数量也会增加。例如,下面,系统试图遵循一个正弦波和一个高度非线性分段函数:
    在这里插入图片描述
    我们可以看到,在第二种情况下,虽然DMP永远不能准确地再现期望的轨迹,但随着基函数数目的增加,近似度会继续变得更好。这种在某些非线性领域的缓慢改进是可以从基函数的放置方式中预料到的。我们使用了随时间均匀分布基函数中心的方法,但为了模拟,Schaal博士的实验室还有另一种方法,将基函数放置得更有策略性。需求由该区域内的功能复杂性决定,并相应地定义基本功能中心和宽度。在高度非线性的区域,我们预计会有许多窄基函数,而在线性区域,我们预计会有较少的基函数,但更宽的基函数。这个方法被称为局部加权投影回归(LWPR),我计划在以后的文章中写它并应用它。

    Conclusions \ thoughts

    真的有很多的力量在这个框架中,有大量的在这个基本设置上的扩充,包括将系统反馈,时空耦合的纯数字,使用纯数字增益控制和轨迹控制,将成本函数和强化学习,识别动作类型,和其他真正令人激动的东西。
    我在一些地方偏离了论文中使用的术语。首先,我看不出有理由把二阶方程组化为两个一阶方程组。当我计算它的时候,我发现它更令人困惑而不是有用,所以我把动力学作为一个二阶系统。第二,我还把 τ \tau τ项移到了右边,这只是为了它匹配代码,这并不重要。这两项变化都不大,但以防你在看报纸时感到疑惑。
    我上面提到的是沿着多个维度进行规划。其实很简单;DMP框架简单地为每个被控制的自由度分配一个DMP。但是,在某些时候,它绝对值得明确地说明。
    我在上面也提到过,但这是一个很好的轨迹控制系统,可以放在之前讨论过的操作空间控制框架之上。在DMP框架之上规划健壮的、可推广的移动,在OSCs之下执行这些命令,我们可以开始得到一些真正整洁的应用程序。对于在真实系统上的应用,将反馈和时空耦合的术语结合起来是很重要的,所以下一篇文章可能会解决这些问题,然后我们可以开始研究一些令人激动的实现!
    说到实现,在我的github上有一个DMP和规范的系统代码,请随意探索它,运行它,给我有关它的问题。无论什么。我还应该提一下,在Stefan Schaal的实验室网站上有很多这样的东西。

    展开全文
  • yarn add @backpacker/primitives # or npm install --save @backpacker/primitives 用法 /* Wrap your App's entry point with the `ConfigProvider` component */ import { ConfigProvider } from '@backpacker...
  • 通过删除隐式依赖项,将迷人的代码与react-primitives结合起来,以在目标之间呈现相同的代码。 仅当您要在多个平台上共享相同的代码时,才使用此程序包。 如果你正在寻找风格为特定平台使用的组件美艳本地的阵营...
  • MonoGame.Primitives2D 2D XNA Primitives项目已移植到现代世界。 NuGet 包: : 示例项目: : 变更日志 2020-02-19 (1.1.1) NuGet软件包修复 ReferencedFrameworkAssemblies在NuGet包中创建了一个问题 2020-...
  • 如何下载 Intel Integrated Performance Primitives –intel IPP
  • cesium-04 primitives.update

    2021-10-09 11:23:50
    https://www.cnblogs.com/fuckgiser/p/6115421.html 1.webworker 构建顶点、法向量等等 2.状态完成后,就继续下面的操作 createVertexArray createRenderState createShaderProgram

    https://www.cnblogs.com/fuckgiser/p/6115421.html

    1.webworker 构建顶点、法向量等等
    2.状态完成后,就继续下面的操作
    createVertexArray
    createRenderState
    createShaderProgram
    3.构建command
    在这里插入图片描述

    在这里插入图片描述

    之后就是续cesium-02 scene render 中下一步executeCommands逻辑了

    参考
    1.https://my.oschina.net/u/4346166/blog/4428713

    展开全文
  • Static utilities for working with the eight ...Booleans Static utility methods pertaining to boolean primitives, that are not already found in either Boolean or Arrays. Bytes Static utility methods pe

    Static utilities for working with the eight primitive types and void.

    See:
    Description

    Class Summary
    Booleans Static utility methods pertaining to boolean primitives, that are not already found in either Boolean or Arrays.
    Bytes Static utility methods pertaining to byte primitives, that are not already found in either Byte or Arrays, and interpret bytes as neither signed nor unsigned.
    Chars Static utility methods pertaining to char primitives, that are not already found in either Character or Arrays.
    Doubles Static utility methods pertaining to double primitives, that are not already found in either Double or Arrays.
    Floats Static utility methods pertaining to float primitives, that are not already found in either Float or Arrays.
    Ints Static utility methods pertaining to int primitives, that are not already found in either Integer or Arrays.
    Longs Static utility methods pertaining to long primitives, that are not already found in either Long or Arrays.
    Primitives Contains static utility methods pertaining to primitive types and their corresponding wrapper types.
    Shorts Static utility methods pertaining to short primitives, that are not already found in either Short or Arrays.
    SignedBytes Static utility methods pertaining to byte primitives that interpret values as signed.
    UnsignedBytes Static utility methods pertaining to byte primitives that interpret values as unsigned (that is, any negative value b is treated as the positive value 256 + b).
    UnsignedLongs Static utility methods pertaining to long primitives that interpret values as unsigned (that is, any negative value x is treated as the positive value 2^64 + x).

    Package com.google.common.primitives Description

    Static utilities for working with the eight primitive types and void.

    This package is a part of the open-source Guava libraries.
    Contents
    General static utilities

    Primitives 
    

    Per-type static utilities

    Booleans
    Bytes
        SignedBytes
        UnsignedBytes 
    Chars
    Doubles
    Floats
    Ints
    Longs
        UnsignedLongs 
    Shorts 
    
    展开全文
  • //primitives加载原型模型 var billboards = viewer.scene.primitives.add(new Cesium.BillboardCollection()); for(var i = 0; i < 5; i++) { billboards.add({ position: new Cesium.Cartesian3.fromDegrees...
  • 在FPGA中,ROM,RAM存储块在IP核配置中都有一个配置选项:Primitives output Register,比如下图的rom IP核配置界面 接下来以RAM读写为例,我这里RAM的第一个数值为1,我们观察第一个数值的位置即可看出这个reg的作用...
  • Primitives Recordering 文中为隶属度矩阵W'和W中所有的列对计算了松弛交并比(RIoU),两个指标向量的RIoU定义如下: 然后,通过匈牙利匹配的方法给出两个矩阵的列之间的最佳一对一对应关系(由RIoU确定)。...
  • In summary, the contributions of our work are as follows: (1) We propose a method for learning and operating a set of functional primitives in a fully decentralized way, without requiring a high-level...
  • Cesium Primitives加载大量图标点

    千次阅读 2020-11-21 23:17:50
    Cesium Primitives加载大量图标点前言效果关键代码 前言 使用entity的方式加载大量图标点会出现卡顿现象,cesium提供了BillboardCollection可以实现大量图标点的显示(测试过5万图标点还是比较流畅的) 效果 关键...
  • npm install sync-primitives 原料药 信号 构造函数 number [value = 1] 获得 Object [选择] boolean [blocking = true] boolean [超时= -1] return : Promise. 释放 锁 function fn Object [选择] boolean ...
  • 1.primitives方式加载: handler.setInputAction(function (evt) { let cartesian = viewer.scene.pickPosition(evt.position); if (Cesium.defined(cartesian)) { let headingPitchRoll = new Cesium.Headi
  • https://docs.nvidia.com/cuda/npp/ NVIDIA 2D Image And Signal Performance Primitives (NPP) Version 10.1.1 MainPage RelatedPages Modules DataStructures NVIDIA 2D Image and Signal...
  • npm install --save react-primitives 您还需要安装要支持的目标: 网络: npm install --save react-dom react-native-web react-art 本机iOS和Android: npm install --save react-native 草图: npm install ...
  • 建立 primitives 集合的时候要这样 new 一个新集合 然后 将其添加到顶层 // 这里一定要 新建 primitives 集合 然后添加到顶层集合中 不然调用 removeAll 会报错 // 参考 ...
  • C++使用内存可用的原始工具1.1 C++应用(application)使用内存(memory)的途径1.2 C++ memory primitives 类别及是否可以重载1.3 primitives 的使用2. 原始工具详解2.1 new/delete expression 1. C++使用内存可用的...
  • AddBillboardPrimitives(id, data, image) { let promise = Cesium.GeoJsonDataSource.load(data)... let bs = this._viewer.scene.primitives.add( new Cesium.BillboardCollection({ scene: this._viewer.scene...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 23,643
精华内容 9,457
关键字:

primitives

友情链接: PLCCable-Drive-CH340.rar