/// <summary> /// Render thumbnail /// </summary> /// <param name="target">Target mesh</param> /// <param name="cameraPos">Camera position</param> /// <param name="alpha">Alpha blend amount</param> /// <param name="displayMatrix">View + projection + display matrix</param> /// <param name="thumbnails">Thumbnail manager</param> public void RenderThumbnail(MeshGeometry3D target, Point3D cameraPos, double alpha, Matrix3D displayMatrix, ThumbnailManager thumbnails) { Point3D[] points = GetFlatPoints(cameraPos, displayMatrix); Rect texture = thumbnails.Get(url); AddRectangleIndices(target); target.Positions.Add(points[0]); target.TextureCoordinates.Add(new Point(texture.Left, texture.Top)); target.Positions.Add(points[1]); target.TextureCoordinates.Add(new Point(texture.Right, texture.Top)); target.Positions.Add(points[2]); target.TextureCoordinates.Add(new Point(texture.Right, texture.Bottom)); target.Positions.Add(points[3]); target.TextureCoordinates.Add(new Point(texture.Left, texture.Bottom)); }
/// <summary> /// Render thumbnail /// </summary> /// <param name="target">Target mesh</param> /// <param name="cameraPos">Camera position</param> /// <param name="alpha">Alpha blend amount</param> /// <param name="displayMatrix">View + projection + display matrix</param> /// <param name="thumbnails">Thumbnail manager</param> public void RenderThumbnail( MeshGeometry3D target, Point3D cameraPos, double alpha, Matrix3D displayMatrix, ThumbnailManager thumbnails ) { Point3D[] points = GetFlatPoints( cameraPos, displayMatrix ); Rect texture = thumbnails.Get( url ); AddRectangleIndices( target ); target.Positions.Add( points[ 0 ] ); target.TextureCoordinates.Add( new Point( texture.Left, texture.Top ) ); target.Positions.Add( points[ 1 ] ); target.TextureCoordinates.Add( new Point( texture.Right, texture.Top ) ); target.Positions.Add( points[ 2 ] ); target.TextureCoordinates.Add( new Point( texture.Right, texture.Bottom ) ); target.Positions.Add( points[ 3 ] ); target.TextureCoordinates.Add( new Point( texture.Left, texture.Bottom ) ); }