main.cpp
上传用户:qccn516
上传日期:2013-05-02
资源大小:3382k
文件大小:1k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. /* 3d2mesh utile
  2.  *
  3.  * Copyright (C) 2003-2004, Alexander Zaprjagaev <frustum@frustum.org>
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  */
  19. #include <stdio.h>
  20. #include "mesh.h"
  21. /*
  22.  */
  23. int main(int argc,char **argv) {
  24. if(argc < 2) {
  25. printf("3d (.3ds or raw .mesh) to strip .mesh utilen");
  26. printf("usage: %s <3d file> ...n",argv[0]);
  27. printf("written by Alexander Zaprjagaevn");
  28. printf("frustum@frustum.orgn");
  29. printf("http://frustum.orgn");
  30. return 0;
  31. }
  32. for(int i = 1; i < argc; i++) {
  33. char name[1024];
  34. strcpy(name,argv[i]);
  35. char *s = strrchr(name,'.');
  36. if(s) strcpy(s,".mesh");
  37. else strcat(name,".mesh");
  38. Mesh *mesh = new Mesh(argv[i]);
  39. if(mesh->getNumSurfaces() != 0) {
  40. printf("%s -> %sn",argv[i],name);
  41. mesh->save(name);
  42. }
  43. delete mesh;
  44. }
  45. return 0;
  46. }