obj-loader-master
所属分类:OpenGL
开发工具:C/C++
文件大小:5016KB
下载次数:1
上传日期:2019-03-04 16:02:18
上 传 者:
罗特帅
说明: obj是三维模型的通用格式,本程序可以加载obj三维格式模型,进行深度开发。
(Obj is a general format of three-dimensional model, this program can load the obj three-dimensional format model for in-depth development.)
文件列表:
data (0, 2015-07-11)
data\bunny_1k.obj (29264, 2015-07-11)
data\bunny_200.obj (5410, 2015-07-11)
data\castle.obj (385391, 2015-07-11)
data\complex.obj (44711, 2015-07-11)
data\cube.obj (172, 2015-07-11)
data\cube2.obj (811, 2015-07-11)
data\f-16.obj (284767, 2015-07-11)
data\face.obj (157919, 2015-07-11)
data\flowers.obj (689386, 2015-07-11)
data\porsche.obj (499870, 2015-07-11)
data\rose+vase.obj (250706, 2015-07-11)
data\soccerball.obj (199304, 2015-07-11)
data\teapot.obj (210644, 2015-07-11)
data\torus.obj (367, 2015-07-11)
freeglut.dll (218624, 2015-07-11)
hw4.sln (929, 2015-07-11)
hw4.vcxproj (12294, 2015-07-11)
hw4.vcxproj.filters (16862, 2015-07-11)
hw4.vcxproj.user (217, 2015-07-11)
include (0, 2015-07-11)
include\FL (0, 2015-07-11)
include\FL\Enumerations.H (40530, 2015-07-11)
include\FL\Fl.H (51361, 2015-07-11)
include\FL\Fl_Adjuster.H (2172, 2015-07-11)
include\FL\Fl_BMP_Image.H (963, 2015-07-11)
include\FL\Fl_Bitmap.H (2324, 2015-07-11)
include\FL\Fl_Box.H (1590, 2015-07-11)
include\FL\Fl_Browser.H (11956, 2015-07-11)
include\FL\Fl_Browser_.H (14711, 2015-07-11)
include\FL\Fl_Button.H (5652, 2015-07-11)
include\FL\Fl_Cairo.H (2923, 2015-07-11)
include\FL\Fl_Cairo_Window.H (2531, 2015-07-11)
include\FL\Fl_Chart.H (4737, 2015-07-11)
include\FL\Fl_Check_Browser.H (3349, 2015-07-11)
include\FL\Fl_Check_Button.H (943, 2015-07-11)
include\FL\Fl_Choice.H (3381, 2015-07-11)
... ...
# Object Viewer
* Zhang Qiuyi, 12330402
## Dependencies
* glm(with some modification, included as source code)
* fltk(a win32 build is included)
## What is it?
A Wavefront .obj viwer, with .mtl support and GUI.
![Normal screenshot](screenshots/bunny.png)
## Operations
### Menu
* `File/Open`: open a .obj file(it will automatically load related .mtl files)
* `File/Quit`: quit
* `Flat`: use flat shading
* `Smooth`: use smooth shading
* `Light1`: toggle light 1
* `Light2`: toggle light 2
* `Reset camera`: reset the camera(in case you get lost)
### Mouse drag
* Left button: rotate the object
* Middle button: translate the object
* Right button: zoom in/out on the object
Note: If you can't see the object after opening it, try using your mouse to adjust the camera. It may be that the object is too big/small or placed too far/close.
### Preview
Flat shading:
![](screenshots/bunny-flat.png)
Light 1:
![](screenshots/bunny-light-1.png)
Light 2:
![](screenshots/bunny-light-2.png)
Flower:
![](screenshots/flower.png)
Vase:
![](screenshots/vase.png)
Castle:
![](screenshots/castle.png)
F-16:
![](screenshots/f-16.png)
## File structure
```
- doc // report goes here
- include // header files
- lib // static libraries
- data // sample .obj and .mtl files
- src // source code
- screenshots // screenshots
// dynamic library for the prebuilt executable
- freeglut.dll
- hw4.sln // VS2013 project file
- hw4.exe // prebuilt executable
- README.md // you are reading it :)
```
## About the executable
The executable `hw4.exe` is built for Windows with VS2013. If you have VS2013 installed(which means you have libraries like `msvcr120.dll` installed), you can run the executable directly. Otherwise you need to build it from source.
## How to build it?
If you are using VS2013, just open `hw4.sln` and build the `hw4` target. If you are using VS2015, you can try to do this too.
If you are using VS2012 or other versions of VS, follow this steps:
1. Create a new project from the existing code(make sure it's a console application instead of a windowed application), include all `.cpp` and `.h` files
2. Make sure VC++ will include `.\include` in its `INCLUDE` environment variable(e.g. Open `Properties -> Configuration Properties -> VC++ Directories -> Include Directories` and add `.\include`)
3. Make sure VC++ will include `.\lib` in its `INCLUDE` environment variable(e.g. Open `Properties -> Configuration Properties -> VC++ Directories -> Library Directories` and add `.\lib`)
4. The linker needs to link these libraries(e.g. Open `Properties -> Configuration Properties -> Linker -> Additional Dependencies` and add them):
* `fltk.lib`
* `fltkgl.lib`
* `freeglut.lib`
* `opengl32.lib`
* `glu32.lib`
5. Make sure the executable will be output to the project directory(e.g. Open `Properties -> Configuration Properties -> General` and set `Output Directory` to `$(SolutionDir)\`).
6. Build the `hw4` target.
Warning: this program needs C++11 support(e.g. smart pointers), so an ancient VS might not be able to build it.
## Troubleshooting
If you can't build the program using the FLTK included in the project, you need to build it again. Follow the steps in [this link](https://bewuethr.github.io/installing-fltk-133-under-visual-studio/), and copy the `FL` folder(containing header files) into `include/`, and all built `.lib`s into `lib/`.
近期下载者:
相关文件:
收藏者: