zoukankan      html  css  js  c++  java
  • Unity3D人脸建模 AvataSDK研究

    1.Unity与windows交互 调用文件浏览器

    1.用C#调用comdlg32.dll  ,  利用GetOpenFileName实现打开文件对话框

    <1> 整体参考https://www.cnblogs.com/chinarbolg/p/9601432.html

    <2>文件过滤属性设置参考https://zhidao.baidu.com/question/221417585.html

    pth.filter = "jpg files*.jpgpng files*.pngjpeg files*.jpeg";

    jpg files是显示的内容,是转义字符,*.jpg是过滤格式,然后是下一个过滤器

    完整形式openFileName.filter = "图片文件(*.jpg,*.png,*.bmp)*.jpg;*.png;*.bmp";

    2.面部表情制作,BlendShapes

    1.参考https://www.jianshu.com/p/4ae6662a40df

     

    3.将一个Mesh的BlendShape复制到另一个Mesh上

    // Copy blend shape data from myMesh to tmpMesh
     
     Vector3[] dVertices = new Vector3[myMesh.vertexCount];
     Vector3[] dNormals = new Vector3[myMesh.vertexCount];
     Vector3[] dTangents= new Vector3[myMesh.vertexCount];
     for (int shape = 0; shape < myMesh.blendShapeCount; shape++) {
         for (int frame = 0; frame < myMesh.GetBlendShapeFrameCount(shape); frame++) {
             string shapeName = myMesh.GetBlendShapeName(shape);
             float frameWeight = myMesh.GetBlendShapeFrameWeight(shape, frame);
     
             myMesh.GetBlendShapeFrameVertices(shape, frame, dVertices, dNormals, dTangents);
             tmpMesh.AddBlendShapeFrame(shapeName, frameWeight, dVertices, dNormals, dTangents);
         }
     }
  • 相关阅读:
    hihocoder #1138 : Islands Travel
    关于c中的inline
    LUOGU P2921 [USACO08DEC]在农场万圣节Trick or Treat on the Farm
    LUOGU P1908 逆序对
    归并排序 (模板)
    tyvj 1864 守卫者的挑战
    loj #10001. 「一本通 1.1 例 2」种树
    bzoj 1026: [SCOI2009]windy数
    BZOJ 4521: [Cqoi2016]手机号码
    LUOGU 3089 后缀排序(模板)
  • 原文地址:https://www.cnblogs.com/white-L/p/10650362.html
Copyright © 2011-2022 走看看