mrfangzheng

Hope and fear are useless. Be confident, and always be prepared for the worst.
  首页  :: 新随笔  :: 联系 :: 管理

WPF : 3D 给GeometryModel3D对象贴图

Posted on 2008-05-02 16:46  mrfangzheng  阅读(1270)  评论(0编辑  收藏  举报
GeometryModel3D model = .;

string imgFile = @"C:\a.jpg"
;
Uri imgUri 
= new
 Uri( imgFile, UriKind.RelativeOrAbsolute );
ImageSource imgSrc 
= new
 BitmapImage( imgUri ); //load image

DiffuseMaterial mtr 
= new
 DiffuseMaterial();
mtr.Brush 
= new
 ImageBrush( imgSrc );

model.Material 
= mtr;