Merge branch 'develop' of github.com:syoyo/tinyobjloader into develop
This commit is contained in:
@@ -40,11 +40,15 @@ What's new
|
|||||||
Example
|
Example
|
||||||
-------
|
-------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
tinyobjloader can successfully load 6M triangles Rungholt scene.
|
tinyobjloader can successfully load 6M triangles Rungholt scene.
|
||||||
http://graphics.cs.williams.edu/data/meshes.xml
|
http://graphics.cs.williams.edu/data/meshes.xml
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* [examples/viewer/](examples/viewer) OpenGL .obj viewer
|
||||||
|
|
||||||
Use case
|
Use case
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,16 @@
|
|||||||
Simple .obj viewer with glew + glfw3 + OpenGL
|
# Simple .obj viewer with glew + glfw3 + OpenGL
|
||||||
|
|
||||||
|
## Build on Windows.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
* premake5
|
||||||
|
* Visual Studio 2013
|
||||||
|
* Windows 64bit
|
||||||
|
* 32bit may work.
|
||||||
|
|
||||||
|
Put glfw3 and glew library somewhere and replace include and lib path in `premake4.lua`
|
||||||
|
|
||||||
|
Then,
|
||||||
|
|
||||||
|
> premake5.exe vs2013
|
||||||
|
|||||||
43
examples/viewer/premake4.lua
Normal file
43
examples/viewer/premake4.lua
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
solution "objview"
|
||||||
|
-- location ( "build" )
|
||||||
|
configurations { "Debug", "Release" }
|
||||||
|
platforms {"native", "x64", "x32"}
|
||||||
|
|
||||||
|
project "objview"
|
||||||
|
|
||||||
|
kind "ConsoleApp"
|
||||||
|
language "C++"
|
||||||
|
files { "viewer.cc", "trackball.cc" }
|
||||||
|
includedirs { "./" }
|
||||||
|
includedirs { "../../" }
|
||||||
|
|
||||||
|
configuration { "linux" }
|
||||||
|
linkoptions { "`pkg-config --libs glfw3`" }
|
||||||
|
links { "GL", "GLU", "m", "GLEW", "X11", "Xrandr", "Xinerama", "Xi", "Xxf86vm", "Xcursor", "dl" }
|
||||||
|
|
||||||
|
configuration { "windows" }
|
||||||
|
-- Path to GLFW3
|
||||||
|
includedirs { '../../../../local/glfw-3.1.2.bin.WIN64/include' }
|
||||||
|
libdirs { '../../../../local/glfw-3.1.2.bin.WIN64/lib-vc2013' }
|
||||||
|
-- Path to GLEW
|
||||||
|
includedirs { '../../../../local/glew-1.13.0/include' }
|
||||||
|
libdirs { '../../../../local/glew-1.13.0/lib/Release/x64' }
|
||||||
|
|
||||||
|
links { "glfw3", "glew32", "gdi32", "winmm", "user32", "glu32","opengl32", "kernel32" }
|
||||||
|
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||||
|
|
||||||
|
configuration { "macosx" }
|
||||||
|
includedirs { "/usr/local/include" }
|
||||||
|
buildoptions { "-Wno-deprecated-declarations" }
|
||||||
|
libdirs { "/usr/local/lib" }
|
||||||
|
links { "glfw3", "GLEW" }
|
||||||
|
linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit", "-framework CoreVideo" }
|
||||||
|
|
||||||
|
configuration "Debug"
|
||||||
|
defines { "DEBUG" }
|
||||||
|
flags { "Symbols", "ExtraWarnings"}
|
||||||
|
|
||||||
|
configuration "Release"
|
||||||
|
defines { "NDEBUG" }
|
||||||
|
flags { "Optimize", "ExtraWarnings"}
|
||||||
|
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
|
#define TINYOBJLOADER_IMPLEMENTATION
|
||||||
#include "../../tiny_obj_loader.h"
|
#include "../../tiny_obj_loader.h"
|
||||||
|
|
||||||
#include "trackball.h"
|
#include "trackball.h"
|
||||||
@@ -203,7 +205,7 @@ void reshapeFunc(GLFWwindow* window, int w, int h)
|
|||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluPerspective(45.0, (float)w / (float)h, 0.1f, 1000.0f);
|
gluPerspective(45.0, (float)w / (float)h, 0.01f, 100.0f);
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
|
|||||||
BIN
images/sanmugel.png
Normal file
BIN
images/sanmugel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
@@ -20,6 +20,18 @@ Are installed.
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
|
Visual Studio 2013 is required to build tester.
|
||||||
|
|
||||||
|
On Windows console.
|
||||||
|
|
||||||
> python kuroga.py config-msvc.py
|
> python kuroga.py config-msvc.py
|
||||||
> vcbuild.bat
|
> vcbuild.bat
|
||||||
|
|
||||||
|
|
||||||
|
Or on msys2 bash,
|
||||||
|
|
||||||
|
$ python kuroga.py config-msvc.py
|
||||||
|
$ cmd //c vcbuild.bat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user