aboutsummaryrefslogtreecommitdiff
path: root/works/teapot
diff options
context:
space:
mode:
Diffstat (limited to 'works/teapot')
-rw-r--r--works/teapot/.dockerignore1
-rw-r--r--works/teapot/.github/workflows/ci.yaml27
-rw-r--r--works/teapot/.gitignore1
-rw-r--r--works/teapot/CMakeLists.txt35
-rw-r--r--works/teapot/README.md10
-rw-r--r--works/teapot/debian/control8
-rw-r--r--works/teapot/main.cpp20
-rw-r--r--works/teapot/main.qml270
-rw-r--r--works/teapot/qml.qrc6
-rwxr-xr-xworks/teapot/script/build-deb.bash12
-rwxr-xr-xworks/teapot/script/install-deps.bash3
-rw-r--r--works/teapot/teapot.meshbin42656 -> 0 bytes
-rw-r--r--works/teapot/view3d.pro14
13 files changed, 0 insertions, 407 deletions
diff --git a/works/teapot/.dockerignore b/works/teapot/.dockerignore
deleted file mode 100644
index c795b05..0000000
--- a/works/teapot/.dockerignore
+++ /dev/null
@@ -1 +0,0 @@
-build \ No newline at end of file
diff --git a/works/teapot/.github/workflows/ci.yaml b/works/teapot/.github/workflows/ci.yaml
deleted file mode 100644
index 9420964..0000000
--- a/works/teapot/.github/workflows/ci.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: CI
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- build:
- name: Build
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v3
-
- - name: Install Build Dependencies
- run: bash ./script/install-deps.bash
-
- - name: Build Deb Package
- run: bash ./script/build-deb.bash
-
- - name: Upload Artifact
- uses: actions/upload-artifact@v3
- with:
- name: deb-package
- path: build/package.deb
diff --git a/works/teapot/.gitignore b/works/teapot/.gitignore
deleted file mode 100644
index c795b05..0000000
--- a/works/teapot/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build \ No newline at end of file
diff --git a/works/teapot/CMakeLists.txt b/works/teapot/CMakeLists.txt
deleted file mode 100644
index 0bbff29..0000000
--- a/works/teapot/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(crupest-teapot LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D)
-
-qt_add_executable(crupest-teapot
- main.cpp
-)
-
-set_target_properties(crupest-teapot PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(crupest-teapot PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Quick
- Qt::Quick3D
-)
-
-qt_add_qml_module(crupest-teapot
- URI Example
- VERSION 1.0
- QML_FILES main.qml
- RESOURCES teapot.mesh
- NO_RESOURCE_TARGET_PATH
-)
-
-install(TARGETS crupest-teapot)
diff --git a/works/teapot/README.md b/works/teapot/README.md
deleted file mode 100644
index caf2eaf..0000000
--- a/works/teapot/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-From https://github.com/qt/qtquick3d/tree/dev/examples/quick3d/view3d
-
-This package only works on Ubuntu 22.04 because it relies on the system qt6 libs. At least I only test this platform. Other platforms might also work if the lib linkage is right. However, another way is to bundle all dependencies into the deb, which looks like most apps would do. But I'm new to deb package system and I'm in a hurry with no time to do more research.
-
-In a word,
-
-1. Make sure you are on Ubuntu 22.04.
-2. Download `package.deb` from ci.
-3. Run `sudo apt-get install package.deb` (NOT `dpkg`), and apt will take care of dependencies for you.
-4. Run `crupest-teapot` and enjoy yourself!
diff --git a/works/teapot/debian/control b/works/teapot/debian/control
deleted file mode 100644
index 74aab7c..0000000
--- a/works/teapot/debian/control
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: crupest-teapot
-Version: 1.0-1
-Section: utils
-Priority: optional
-Architecture: all
-Maintainer: crupest <crupest@outlook.com>
-Description: This is a test application for packaging
-Depends: qt6-qpa-plugins,libqt63dquick6,qml6-module-qtqml,qml6-module-qtqml-workerscript,qml6-module-qtquick,qml6-module-qtquick-templates,qml6-module-qtquick-controls,qml6-module-quick3d
diff --git a/works/teapot/main.cpp b/works/teapot/main.cpp
deleted file mode 100644
index 804f8ff..0000000
--- a/works/teapot/main.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <QtQuick3D/qquick3d.h>
-
-int main(int argc, char *argv[])
-{
- QGuiApplication app(argc, argv);
- QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
- qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
-
- QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
- if (engine.rootObjects().isEmpty())
- return -1;
-
- return app.exec();
-}
diff --git a/works/teapot/main.qml b/works/teapot/main.qml
deleted file mode 100644
index 8f61137..0000000
--- a/works/teapot/main.qml
+++ /dev/null
@@ -1,270 +0,0 @@
-// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-import QtQuick
-import QtQuick3D
-import QtQuick.Controls
-
-Window {
- id: window
- width: 1280
- height: 720
- visible: true
- title: "View3Ds with Different Cameras"
- color: "#848895"
-
- // The root scene
- //! [rootnode]
- Node {
- id: standAloneScene
- //! [rootnode]
-
- DirectionalLight {
- ambientColor: Qt.rgba(0.5, 0.5, 0.5, 1.0)
- brightness: 1.0
- eulerRotation.x: -25
- }
-
- Model {
- source: "#Cube"
- y: -104
- scale: Qt.vector3d(3, 3, 0.1)
- eulerRotation.x: -90
- materials: [
- DefaultMaterial {
- diffuseColor: Qt.rgba(0.8, 0.8, 0.8, 1.0)
- }
- ]
- }
-
- Model {
- source: "teapot.mesh"
- y: -100
- scale: Qt.vector3d(50, 50, 50)
- materials: [
- PrincipledMaterial {
- baseColor: "#41cd52"
- metalness: 0.0
- roughness: 0.1
- opacity: 1.0
- }
- ]
-
- PropertyAnimation on eulerRotation.y {
- loops: Animation.Infinite
- duration: 5000
- to: 0
- from: -360
- }
- }
-
- //! [cameras start]
- // The predefined cameras. They have to be part of the scene, i.e. inside the root node.
- // Animated perspective camera
- Node {
- PerspectiveCamera {
- id: cameraPerspectiveOne
- z: 600
- }
-
- PropertyAnimation on eulerRotation.x {
- loops: Animation.Infinite
- duration: 5000
- to: -360
- from: 0
- }
- }
-
- // Stationary perspective camera
- PerspectiveCamera {
- id: cameraPerspectiveTwo
- z: 600
- }
- //! [cameras start]
-
- // Second animated perspective camera
- Node {
- PerspectiveCamera {
- id: cameraPerspectiveThree
- x: 500
- eulerRotation.y: 90
- }
- PropertyAnimation on eulerRotation.y {
- loops: Animation.Infinite
- duration: 5000
- to: 0
- from: -360
- }
- }
-
- // Stationary orthographic camera viewing from the top
- OrthographicCamera {
- id: cameraOrthographicTop
- y: 600
- eulerRotation.x: -90
- }
-
- // Stationary orthographic camera viewing from the front
- OrthographicCamera {
- id: cameraOrthographicFront
- z: 600
- }
-
- //! [cameras end]
- // Stationary orthographic camera viewing from left
- OrthographicCamera {
- id: cameraOrthographicLeft
- x: -600
- eulerRotation.y: -90
- }
- }
- //! [cameras end]
-
- //! [views]
- // The views
- Rectangle {
- id: topLeft
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width * 0.5
- height: parent.height * 0.5
- color: "#848895"
- border.color: "black"
-
- View3D {
- id: topLeftView
- anchors.fill: parent
- importScene: standAloneScene
- camera: cameraOrthographicFront
- }
-
- Label {
- text: "Front"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.margins: 10
- color: "#222840"
- font.pointSize: 14
- }
- }
- //! [views]
-
- Rectangle {
- id: topRight
- anchors.top: parent.top
- anchors.right: parent.right
- width: parent.width * 0.5
- height: parent.height * 0.5
- color: "transparent"
- border.color: "black"
-
- Label {
- text: "Perspective"
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.margins: 10
- color: "#222840"
- font.pointSize: 14
- }
-
- View3D {
- id: topRightView
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.left: parent.left
- anchors.bottom: parent.bottom;
- camera: cameraPerspectiveOne
- importScene: standAloneScene
- renderMode: View3D.Underlay
-
- environment: SceneEnvironment {
- clearColor: window.color
- backgroundMode: SceneEnvironment.Color
- }
- }
-
- Row {
- id: controlsContainer
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
- padding: 10
-
- //! [buttons]
- RoundButton {
- text: "Camera 1"
- highlighted: topRightView.camera == cameraPerspectiveOne
- onClicked: {
- topRightView.camera = cameraPerspectiveOne
- }
- }
- //! [buttons]
- RoundButton {
- text: "Camera 2"
- highlighted: topRightView.camera == cameraPerspectiveTwo
- onClicked: {
- topRightView.camera = cameraPerspectiveTwo
- }
- }
- RoundButton {
- text: "Camera 3"
- highlighted: topRightView.camera == cameraPerspectiveThree
- onClicked: {
- topRightView.camera = cameraPerspectiveThree
- }
- }
- }
- }
-
- Rectangle {
- id: bottomLeft
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width * 0.5
- height: parent.height * 0.5
- color: "#848895"
- border.color: "black"
-
- View3D {
- id: bottomLeftView
- anchors.fill: parent
- importScene: standAloneScene
- camera: cameraOrthographicTop
- }
-
- Label {
- text: "Top"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.margins: 10
- color: "#222840"
- font.pointSize: 14
- }
- }
-
- Rectangle {
- id: bottomRight
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- width: parent.width * 0.5
- height: parent.height * 0.5
- color: "#848895"
- border.color: "black"
-
- View3D {
- id: bottomRightView
- anchors.fill: parent
- importScene: standAloneScene
- camera: cameraOrthographicLeft
- }
-
- Label {
- text: "Left"
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.margins: 10
- color: "#222840"
- font.pointSize: 14
- }
- }
-}
diff --git a/works/teapot/qml.qrc b/works/teapot/qml.qrc
deleted file mode 100644
index b1f4acf..0000000
--- a/works/teapot/qml.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- <file>teapot.mesh</file>
- </qresource>
-</RCC>
diff --git a/works/teapot/script/build-deb.bash b/works/teapot/script/build-deb.bash
deleted file mode 100755
index 954d026..0000000
--- a/works/teapot/script/build-deb.bash
+++ /dev/null
@@ -1,12 +0,0 @@
-set -e
-
-mkdir -p build
-pushd build
-cmake .. "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
-make
-mkdir -p package
-cmake --install . --prefix ./package/
-mkdir -p package/DEBIAN
-cp ../debian/control ./package/DEBIAN/control
-dpkg-deb --root-owner-group --build package
-popd
diff --git a/works/teapot/script/install-deps.bash b/works/teapot/script/install-deps.bash
deleted file mode 100755
index 813b884..0000000
--- a/works/teapot/script/install-deps.bash
+++ /dev/null
@@ -1,3 +0,0 @@
-set -e
-sudo apt-get update
-sudo apt-get install -y build-essential cmake g++ libgl1-mesa-dev qt6-base-dev qt6-declarative-dev qt6-quick3d-dev qt6-quick3d-dev-tools libqt6shadertools6-dev
diff --git a/works/teapot/teapot.mesh b/works/teapot/teapot.mesh
deleted file mode 100644
index 75ff317..0000000
--- a/works/teapot/teapot.mesh
+++ /dev/null
Binary files differ
diff --git a/works/teapot/view3d.pro b/works/teapot/view3d.pro
deleted file mode 100644
index 61455a1..0000000
--- a/works/teapot/view3d.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-QT += quick quick3d
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick3d/view3d
-
-INSTALLS += target
-
-SOURCES += \
- main.cpp
-
-RESOURCES += \
- qml.qrc
-
-OTHER_FILES += \
- doc/src/*.*