Пример #1
0
 //============================================================
 public void LoadResource(FDxRsGeometry resource)
 {
     _name = resource.Name;
     // 创建顶点缓冲
     _vertexBuffer        = new FDxVertexBuffer();
     _vertexBuffer.Device = _device;
     _vertexBuffer.Upload(resource.VertexSize, resource.VertexBuffer.Memory, 0, resource.VertexBuffer.Length);
     // 创建面缓冲
     _faceBuffer        = new FDxFaceBuffer();
     _faceBuffer.Device = _device;
     _faceBuffer.Upload(resource.FaceBuffer.Memory, 0, resource.FaceBuffer.Length);
 }
Пример #2
0
        //============================================================
        public void LoadResource(FDxRsModel resource)
        {
            int count = resource.Mesh.Geometries.Count;

            for (int n = 0; n < count; n++)
            {
                // 创建几何体
                FDxModelGeometry geometry = new FDxModelGeometry();
                geometry.Device = _device;
                // 加载资源
                FDxRsGeometry geometryResource = resource.Mesh.Geometries[n];
                geometry.LoadResource(geometryResource);
                // 存储对象
                _geometries.Set(geometry.Name, geometry);
                _renderables.Push(geometry);
            }
        }