Remove large model resources from the build.
+ Remove Qtk::Skybox dependency on Qt resources.
@ -47,10 +47,14 @@ include(GNUInstallDirs)
|
||||
################################################################################
|
||||
option(QTK_DEBUG "Enable debugger" OFF)
|
||||
option(QTK_SUBMODULES "Update external project (assimp) submodule" OFF)
|
||||
option(QTK_GUI "Build the Qtk desktop application" ON)
|
||||
option(QTK_PLUGINS "Install Qtk plugins to Qt Creator path." OFF)
|
||||
option(QTK_EXAMPLE "Build the Qtk example desktop application" ON)
|
||||
option(QTK_CCACHE "Enable ccache" ON)
|
||||
# Options for qtk_gui
|
||||
option(QTK_GUI "Build the Qtk desktop application" ON)
|
||||
option(QTK_GUI_SCENE
|
||||
"Fetch model resources and build the GUI with an example scene." OFF
|
||||
)
|
||||
|
||||
if (QTK_CCACHE)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
|
||||
|
@ -1,55 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 4
|
||||
|
||||
newmtl AlienHominid
|
||||
Ns 225.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.533344 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Bump normal.png
|
||||
map_Kd diffuse.png
|
||||
map_Ns roughness.png
|
||||
refl specular.png
|
||||
|
||||
newmtl Blaster
|
||||
Ns 225.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Bump blaster_normal.png
|
||||
map_Kd blaster_diffuse.png
|
||||
map_Ke blaster_emissive.png
|
||||
map_Ns blaster_roughness.png
|
||||
refl blaster_specular.png
|
||||
|
||||
newmtl Screenshot_2021-04-19_194508
|
||||
Ns 225.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd smoke.png
|
||||
map_d smoke.png
|
||||
|
||||
newmtl Untitled-1
|
||||
Ns 77.904748
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Untitled-1.png
|
||||
map_d Untitled-1.png
|
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 455 KiB |
Before Width: | Height: | Size: 9.4 MiB |
Before Width: | Height: | Size: 5.2 MiB |
Before Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 8.8 MiB |
Before Width: | Height: | Size: 10 MiB |
Before Width: | Height: | Size: 4.0 MiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 1.8 MiB |
@ -1,16 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Scene_-_Root
|
||||
Ns 225.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.0 0.0 0.0
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd diffuse.jpg
|
||||
map_Bump normal.png
|
||||
map_Ks specular.jpg
|
||||
|
Before Width: | Height: | Size: 5.8 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 4.2 MiB |
@ -1,3 +0,0 @@
|
||||
Model by Berk Gedik, from: https://sketchfab.com/3d-models/survival-guitar-backpack-low-poly-799f8c4511f84fab8c3f12887f7e6b36
|
||||
|
||||
Modified material assignment (Joey de Vries) for easier load in OpenGL model loading chapter, and renamed albedo to diffuse and metallic to specular to match non-PBR lighting setup.
|
Before Width: | Height: | Size: 6.4 MiB |
@ -1,7 +0,0 @@
|
||||
newmtl material_0
|
||||
map_bump normal.jpg
|
||||
norm normal.jpg
|
||||
map_Kd diffuse.jpg
|
||||
occlusion occlusion.jpg
|
||||
Pm 0
|
||||
Pr 0.793152
|
Before Width: | Height: | Size: 11 MiB |
Before Width: | Height: | Size: 3.3 MiB |
Before Width: | Height: | Size: 1.7 MiB |
@ -1,12 +0,0 @@
|
||||
# Blender v2.82 (sub 7) OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib floor.mtl
|
||||
o floor
|
||||
v -1.000000 -0.000000 1.000000
|
||||
v 1.000000 -0.000000 1.000000
|
||||
v 1.000000 0.000000 -1.000000
|
||||
v -1.000000 0.000000 -1.000000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
usemtl Default_OBJ
|
||||
s off
|
||||
f 1//1 2//1 3//1 4//1
|
Before Width: | Height: | Size: 133 KiB |
@ -1,8 +0,0 @@
|
||||
# WaveFront *.mtl file (generated by CINEMA 4D)
|
||||
|
||||
newmtl item/objectcomponents/weapon/staff_2h_artifactdeadwind_d_03.m2_Geoset_000
|
||||
Ka 0.25 0.25 0.25
|
||||
Kd 1 1 1
|
||||
map_Kd diffuse.png
|
||||
illum 7
|
||||
|
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 4.0 MiB |
Before Width: | Height: | Size: 807 KiB |
Before Width: | Height: | Size: 5.9 MiB |
Before Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 614 KiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 4.8 MiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 4.5 MiB |
Before Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 885 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 426 KiB |
Before Width: | Height: | Size: 983 KiB |
Before Width: | Height: | Size: 484 KiB |
Before Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 930 KiB |
Before Width: | Height: | Size: 3.9 MiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 4.4 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 862 KiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 4.0 MiB |
Before Width: | Height: | Size: 1008 KiB |
Before Width: | Height: | Size: 4.8 MiB |
Before Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 638 KiB |
Before Width: | Height: | Size: 844 KiB |
Before Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 3.8 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 761 KiB |
Before Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 2.5 MiB |
Before Width: | Height: | Size: 24 MiB |
Before Width: | Height: | Size: 4.9 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 7.8 MiB |
Before Width: | Height: | Size: 4.3 MiB |
Before Width: | Height: | Size: 1.9 MiB |
@ -1,104 +0,0 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 8
|
||||
|
||||
newmtl Spartan_Arms_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Arms_Mat_BaseColor.png
|
||||
map_Bump Spartan_Arms_Mat_Normal.png
|
||||
refl Spartan_Arms_Mat_Specular.png
|
||||
|
||||
|
||||
newmtl Spartan_Chest_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Chest_Mat_BaseColor.png
|
||||
map_Bump Spartan_Chest_Mat_Normal.png
|
||||
refl Spartan_Chest_Mat_Specular.png
|
||||
|
||||
newmtl Spartan_Ear_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Ears_Mat_BaseColor.png
|
||||
map_Bump Spartan_Ears_Mat_Normal.png
|
||||
refl Spartan_Ears_Mat_Specular.png
|
||||
|
||||
newmtl Spartan_Helmet_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Helmet_Mat_BaseColor.png
|
||||
map_Bump Spartan_Helmet_Mat_Normal.png
|
||||
refl Spartan_Helmet_Mat_Specular.png
|
||||
|
||||
newmtl Spartan_Legs_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Legs_Mat_BaseColor.png
|
||||
map_Bump Spartan_Legs_Mat_Normal.png
|
||||
refl Spartan_Legs_Mat_Specular.png
|
||||
|
||||
newmtl Spartan_Shoulders_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Shoulder_Mat_BaseColor.png
|
||||
map_Bump Spartan_Shoulder_Mat_Normal.png
|
||||
refl Spartan_Shoulder_Mat_Specular.png
|
||||
|
||||
newmtl Spartan_Undersuit_Mat
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Spartan_Undersuit_Mat_BaseColor.png
|
||||
map_Bump Spartan_Undersuit_Mat_Normal.png
|
||||
refl Spartan_Undersuit_Mat_Specular.png
|
||||
|
||||
newmtl lambert1
|
||||
Ns 179.999996
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.500000 0.500000 0.500000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
@ -53,79 +53,4 @@
|
||||
<file alias="skybox.frag">skybox/skybox.frag</file>
|
||||
<file alias="skybox.vert">skybox/skybox.vert</file>
|
||||
</qresource>
|
||||
<qresource prefix="/models">
|
||||
<file>models/spartan/spartan.obj</file>
|
||||
<file>models/alien-hominid/alien.obj</file>
|
||||
<file>models/spartan/spartan.mtl</file>
|
||||
<file>models/spartan/Spartan_Ears_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Undersuit_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Undersuit_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Undersuit_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Undersuit_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Undersuit_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Undersuit_Mat_AO.png</file>
|
||||
<file>models/spartan/Spartan_Shoulder_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Shoulder_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Shoulder_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Shoulder_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Shoulder_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Shoulder_Mat_AO.png</file>
|
||||
<file>models/spartan/Spartan_Legs_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Legs_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Legs_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Legs_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Legs_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Legs_Mat_AO.png</file>
|
||||
<file>models/spartan/Spartan_Helmet_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Helmet_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Helmet_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Helmet_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Helmet_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Helmet_Mat_AO.png</file>
|
||||
<file>models/spartan/Spartan_Ears_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Ears_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Ears_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Ears_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Ears_Mat_AO.png</file>
|
||||
<file>models/spartan/Spartan_Chest_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Chest_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Chest_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Chest_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Chest_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Chest_Mat_AO.png</file>
|
||||
<file>models/spartan/Spartan_Arms_Mat_Specular.png</file>
|
||||
<file>models/spartan/Spartan_Arms_Mat_Roughness.png</file>
|
||||
<file>models/spartan/Spartan_Arms_Mat_Normal.png</file>
|
||||
<file>models/spartan/Spartan_Arms_Mat_Metallic.png</file>
|
||||
<file>models/spartan/Spartan_Arms_Mat_BaseColor.png</file>
|
||||
<file>models/spartan/Spartan_Arms_Mat_AO.png</file>
|
||||
<file>models/spartan/lambert1_Roughness.png</file>
|
||||
<file>models/spartan/lambert1_Nrm.png</file>
|
||||
<file>models/spartan/lambert1_Colour-Opacity.png</file>
|
||||
<file>models/backpack/specular.jpg</file>
|
||||
<file>models/backpack/roughness.jpg</file>
|
||||
<file>models/backpack/diffuse.jpg</file>
|
||||
<file>models/backpack/normal.png</file>
|
||||
<file>models/backpack/backpack.obj</file>
|
||||
<file>models/backpack/backpack.mtl</file>
|
||||
<file>models/backpack/ao.jpg</file>
|
||||
<file>models/alien-hominid/specular.png</file>
|
||||
<file>models/alien-hominid/roughness.png</file>
|
||||
<file>models/alien-hominid/normal.png</file>
|
||||
<file>models/alien-hominid/diffuse.png</file>
|
||||
<file>models/alien-hominid/blaster_specular.png</file>
|
||||
<file>models/alien-hominid/blaster_roughness.png</file>
|
||||
<file>models/alien-hominid/blaster_normal.png</file>
|
||||
<file>models/alien-hominid/blaster_emissive.png</file>
|
||||
<file>models/alien-hominid/blaster_diffuse.png</file>
|
||||
<file>models/alien-hominid/alien.mtl</file>
|
||||
<file>models/scythe/scythe.obj</file>
|
||||
<file>models/scythe/scythe.mtl</file>
|
||||
<file>models/scythe/diffuse.png</file>
|
||||
<file>models/bird/occlusion.jpg</file>
|
||||
<file>models/bird/normal.jpg</file>
|
||||
<file>models/bird/diffuse.jpg</file>
|
||||
<file>models/bird/bird.obj</file>
|
||||
<file>models/bird/bird.mtl</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -9,14 +9,30 @@
|
||||
# Qtk Application
|
||||
################################################################################
|
||||
|
||||
set(QTK_GUI_SOURCES
|
||||
qtkmainwindow.cpp qtkmainwindow.h qtkmainwindow.ui
|
||||
qtkscene.cpp qtkscene.h
|
||||
main.cpp
|
||||
)
|
||||
# Build without the example scene if QTK_GUI_SCENE is unset.
|
||||
if (QTK_GUI_SCENE)
|
||||
set(QTK_GUI_SOURCES
|
||||
qtkmainwindow.cpp qtkmainwindow.h qtkmainwindow.ui
|
||||
# This scene will clone a git repository for required 3D models.
|
||||
qtkscene.cpp qtkscene.h
|
||||
main.cpp
|
||||
)
|
||||
else()
|
||||
# The scene will use a default skybox with no models or examples.
|
||||
# Models can be added by click-and-dragging an .obj into the scene.
|
||||
set(QTK_GUI_SOURCES
|
||||
qtkmainwindow.cpp qtkmainwindow.h qtkmainwindow.ui
|
||||
main.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
qt_add_executable(qtk_gui ${QTK_GUI_SOURCES})
|
||||
target_link_libraries(qtk_gui PRIVATE qtk_plugin_library)
|
||||
|
||||
if (QTK_GUI_SCENE)
|
||||
target_compile_definitions(qtk_gui PUBLIC QTK_GUI_SCENE)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties(qtk_gui PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
elseif(APPLE)
|
||||
|
@ -24,7 +24,11 @@ int main(int argc, char * argv[])
|
||||
// NOTE: We set the scene here and not in QtkMainWindow to detach the scene
|
||||
// from the QtkWidget plugin (qtk_plugin_library build target).
|
||||
// Once we can save / load scenes, this call, and QtkScene, can be removed.
|
||||
#ifdef QTK_GUI_SCENE
|
||||
window->setScene(new QtkScene);
|
||||
#else
|
||||
window->setScene(new EmptyScene);
|
||||
#endif
|
||||
|
||||
window->show();
|
||||
|
||||
|
@ -49,7 +49,17 @@ namespace Ui
|
||||
*/
|
||||
class EmptyScene : public Qtk::Scene
|
||||
{
|
||||
void init() override { setSceneName("Empty Scene"); }
|
||||
void init() override
|
||||
{
|
||||
setSkybox(new Qtk::Skybox(":/textures/skybox/right.png",
|
||||
":/textures/skybox/top.png",
|
||||
":/textures/skybox/front.png",
|
||||
":/textures/skybox/left.png",
|
||||
":/textures/skybox/bottom.png",
|
||||
":/textures/skybox/back.png",
|
||||
"Skybox"));
|
||||
setSceneName("Empty Scene");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -97,7 +107,7 @@ class MainWindow : public QMainWindow
|
||||
Qtk::QtkWidget * getQtkWidget(const QString & name);
|
||||
|
||||
/**
|
||||
* @param scene The new scene to view.
|
||||
* @param scene The new scene to view.
|
||||
*/
|
||||
void setScene(Qtk::Scene * scene);
|
||||
|
||||
|
@ -6,6 +6,10 @@
|
||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||
##############################################################################*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
|
||||
#include "qtkscene.h"
|
||||
|
||||
using namespace Qtk;
|
||||
@ -35,8 +39,38 @@ QtkScene::~QtkScene()
|
||||
|
||||
void QtkScene::init()
|
||||
{
|
||||
// Clone qtk-resources if it doesn't already exist.
|
||||
QDir repoDir("resources/");
|
||||
if (!repoDir.exists()) {
|
||||
qDebug() << "Cloning qtk-resources repository to '"
|
||||
<< repoDir.absolutePath() << "'...";
|
||||
|
||||
// Run git clone
|
||||
QProcess gitProcess;
|
||||
gitProcess.setWorkingDirectory(QCoreApplication::applicationDirPath());
|
||||
gitProcess.start("git",
|
||||
{"clone",
|
||||
"https://git.shaunreed.com/shaunrd0/qtk-resources.git",
|
||||
repoDir.absolutePath()});
|
||||
|
||||
// Wait indefinitely for the process to complete
|
||||
gitProcess.waitForFinished(-1);
|
||||
// Check the result
|
||||
if (gitProcess.exitCode() == 0) {
|
||||
qDebug() << "Repository cloned successfully.";
|
||||
} else {
|
||||
qDebug() << "Git clone failed:" << gitProcess.readAllStandardError();
|
||||
}
|
||||
}
|
||||
|
||||
// Add a skybox to the scene using default cube map images and settings.
|
||||
setSkybox(new Qtk::Skybox("Skybox"));
|
||||
setSkybox(new Qtk::Skybox(":/textures/skybox/right.png",
|
||||
":/textures/skybox/top.png",
|
||||
":/textures/skybox/front.png",
|
||||
":/textures/skybox/left.png",
|
||||
":/textures/skybox/bottom.png",
|
||||
":/textures/skybox/back.png",
|
||||
"Skybox"));
|
||||
|
||||
/* Create a red cube with a mini master chief on top. */
|
||||
auto myCube = new MeshRenderer("My cube", Cube(Qtk::QTK_DRAW_ELEMENTS));
|
||||
@ -44,8 +78,7 @@ void QtkScene::init()
|
||||
myCube->getTransform().setTranslation(5.0f, 0.0f, 0.0f);
|
||||
addObject(myCube);
|
||||
|
||||
auto mySpartan =
|
||||
new Model("My spartan", ":/models/models/spartan/spartan.obj");
|
||||
auto mySpartan = new Model("My spartan", QTK_SPARTAN);
|
||||
mySpartan->getTransform().setTranslation(5.0f, 0.5f, 0.0f);
|
||||
mySpartan->getTransform().setScale(0.5f);
|
||||
addObject(mySpartan);
|
||||
@ -82,31 +115,27 @@ void QtkScene::init()
|
||||
//
|
||||
// 3D Model loading
|
||||
|
||||
auto model = addObject(
|
||||
new Qtk::Model("backpack", ":/models/models/backpack/backpack.obj"));
|
||||
auto model = addObject(new Qtk::Model("backpack", QTK_BACKPACK));
|
||||
// Sometimes model textures need flipped in certain directions
|
||||
model->flipTexture("diffuse.jpg", false, true);
|
||||
model->getTransform().setTranslation(0.0f, 0.0f, -10.0f);
|
||||
|
||||
model = addObject(new Qtk::Model("bird", ":/models/models/bird/bird.obj"));
|
||||
model = addObject(new Qtk::Model("bird", QTK_BIRD));
|
||||
model->getTransform().setTranslation(2.0f, 2.0f, -10.0f);
|
||||
// Sometimes the models are very large
|
||||
model->getTransform().scale(0.0025f);
|
||||
model->getTransform().rotate(-110.0f, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
model = addObject(
|
||||
new Qtk::Model("alien", ":/models/models/alien-hominid/alien.obj"));
|
||||
model = addObject(new Qtk::Model("alien", QTK_ALIEN));
|
||||
model->getTransform().setTranslation(2.0f, -1.0f, -5.0f);
|
||||
model->getTransform().scale(0.15f);
|
||||
|
||||
model = addObject(
|
||||
new Qtk::Model("My scythe", ":/models/models/scythe/scythe.obj"));
|
||||
model = addObject(new Qtk::Model("My scythe", QTK_SCYTHE));
|
||||
model->getTransform().setTranslation(-6.0f, 0.0f, -10.0f);
|
||||
model->getTransform().rotate(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||
model->getTransform().rotate(90.0f, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
model = addObject(
|
||||
new Qtk::Model("masterChief", ":/models/models/spartan/spartan.obj"));
|
||||
model = addObject(new Qtk::Model("masterChief", QTK_SPARTAN));
|
||||
model->getTransform().setTranslation(-1.5f, 0.5f, -2.0f);
|
||||
|
||||
|
||||
@ -232,7 +261,7 @@ void QtkScene::init()
|
||||
|
||||
/* Test alien Model with phong lighting and specular mapping. */
|
||||
model = addObject(new Qtk::Model("alienTest",
|
||||
":/models/models/alien-hominid/alien.obj",
|
||||
QTK_ALIEN,
|
||||
":/shaders/model-phong.vert",
|
||||
":/shaders/model-phong.frag"));
|
||||
model->getTransform().setTranslation(3.0f, -1.0f, 10.0f);
|
||||
@ -259,7 +288,7 @@ void QtkScene::init()
|
||||
|
||||
/* Test spartan Model with phong lighting, specular and normal mapping. */
|
||||
model = addObject(new Qtk::Model("spartanTest",
|
||||
":/models/models/spartan/spartan.obj",
|
||||
QTK_SPARTAN,
|
||||
":/shaders/model-phong.vert",
|
||||
":/shaders/model-phong.frag"));
|
||||
model->getTransform().setTranslation(0.0f, -1.0f, 10.0f);
|
||||
|
@ -11,6 +11,12 @@
|
||||
|
||||
#include <qtk/scene.h>
|
||||
|
||||
#define QTK_SPARTAN "resources/models/spartan/spartan.obj"
|
||||
#define QTK_BACKPACK "resources/models/backpack/backpack.obj"
|
||||
#define QTK_BIRD "resources/models/bird/bird.obj"
|
||||
#define QTK_ALIEN "resources/models/alien-hominid/alien.obj"
|
||||
#define QTK_SCYTHE "resources/models/scythe/scythe.obj"
|
||||
|
||||
/**
|
||||
* Example scene using QtkWidget to render 3D models and simple geometry within
|
||||
* QtOpenGLWidgets. This scene also shows some examples of using GLSL shaders to
|
||||
|
@ -37,7 +37,7 @@ WidgetPluginCollection::WidgetPluginCollection(QObject * parent) :
|
||||
"Qtk::ToolBox",
|
||||
"toolbox.h",
|
||||
[](QWidget * parent) { return new Qtk::ToolBox(parent); }),
|
||||
// TODO: Add and test DebugConsole, separate source code into plugins/ dir
|
||||
// TODO: Add and test DebugConsole.
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -16,17 +16,6 @@ using namespace Qtk;
|
||||
* Constructors / Destructors
|
||||
******************************************************************************/
|
||||
|
||||
Skybox::Skybox(const std::string & name) :
|
||||
Skybox(":/textures/skybox/right.png",
|
||||
":/textures/skybox/top.png",
|
||||
":/textures/skybox/front.png",
|
||||
":/textures/skybox/left.png",
|
||||
":/textures/skybox/bottom.png",
|
||||
":/textures/skybox/back.png",
|
||||
name)
|
||||
{
|
||||
}
|
||||
|
||||
Skybox::Skybox(QOpenGLTexture * cubeMap, const std::string & name)
|
||||
{
|
||||
mTexture.setTexture(cubeMap);
|
||||
|
@ -36,13 +36,6 @@ namespace Qtk
|
||||
|
||||
// Delegate this constructor to use default skybox images
|
||||
|
||||
/**
|
||||
* Construct Skybox using default images.
|
||||
*
|
||||
* @param name The objectName to use for the Skybox.
|
||||
*/
|
||||
explicit Skybox(const std::string & name = "Skybox");
|
||||
|
||||
/**
|
||||
* Construct a skybox with an existing QOpenGLTexture.
|
||||
* The texture should be a fully initialized cube map.
|
||||
|