public void SetPositions(PositionBuffer positions) { ////TODO:如果用此方式,则必须先将此对象加入scene树,然后再调用Init //OpenGL gl = this.TraverseToRootElement().ParentScene.OpenGL; if (positionBuffer == null) { positionBuffer = new uint[1]; positionBuffer[0] = CreateVertexBufferObject(OpenGL.GL_ARRAY_BUFFER, positions, OpenGL.GL_STREAM_DRAW); } else { UpdateTextureCoords(positions); } }
protected void UpdatePositions(PositionBuffer positions) { gl.BindBuffer(OpenGL.GL_ARRAY_BUFFER, this.positionBuffer[0]); IntPtr destVisibles = gl.MapBuffer(OpenGL.GL_ARRAY_BUFFER, OpenGL.GL_READ_WRITE); MemoryHelper.CopyMemory(destVisibles, positions.Data, (uint)positions.SizeInBytes); gl.UnmapBuffer(OpenGL.GL_ARRAY_BUFFER); }
public HexahedronMeshGeometry3D(PositionBuffer positions, HalfHexahedronIndexBuffer triangleIndices) :base(positions) { this.halfHexahedronIndices = triangleIndices; }