mirror of
https://github.com/ConjureETS/LOG750-LAB2.git
synced 2026-03-24 03:21:19 +00:00
Cel Shade Toggle
This commit is contained in:
parent
63037d90c6
commit
545f78d0dc
120
mainwindow.ui
120
mainwindow.ui
@ -56,7 +56,6 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<zorder>speedSlider</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
@ -64,7 +63,7 @@
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="3" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="cw_x">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -74,7 +73,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="ccw_x">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -84,55 +83,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Couleur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="action_delete">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete Cube</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Vide</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Triangle</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Carré</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Cercle</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Forme</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -145,7 +96,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="0" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -158,40 +109,17 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Couleur</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="ccw_y">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="action_delete">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+Y</string>
|
||||
<string>Delete Cube</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="cw_y">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-Y</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="ccw_z">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -201,7 +129,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="cw_y">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-Y</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="cw_z">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -211,6 +149,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="ccw_y">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+Y</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
@ -282,6 +230,7 @@
|
||||
</widget>
|
||||
<addaction name="actionTextures"/>
|
||||
<addaction name="actionNormal_Maps"/>
|
||||
<addaction name="actionCel_Shading"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuInterpolation"/>
|
||||
</widget>
|
||||
@ -405,6 +354,17 @@
|
||||
<string>Normal Maps</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCel_Shading">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cel Shading</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
|
||||
@ -1332,6 +1332,11 @@ void Viewer::rotateSelectedObjZCW() {
|
||||
rotateSelected(RotateDirection::Z_CW);
|
||||
}
|
||||
|
||||
void Viewer::toggleCelShading(bool on) {
|
||||
m_program->bind();
|
||||
m_program->setUniformValue(m_useToonShading, on);
|
||||
}
|
||||
|
||||
void Viewer::animationSpeedChange(int val) {
|
||||
frame_mult = fmax(double(val) / 10, 0.05);
|
||||
}
|
||||
|
||||
@ -86,6 +86,7 @@ public slots:
|
||||
void rotateSelectedObjYCW();
|
||||
void rotateSelectedObjZCCW();
|
||||
void rotateSelectedObjZCW();
|
||||
void toggleCelShading(bool);
|
||||
void animationSpeedChange(int);
|
||||
|
||||
signals:
|
||||
|
||||
@ -36,9 +36,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
controlGroup->addButton(ui->cw_y);
|
||||
controlGroup->addButton(ui->ccw_z);
|
||||
controlGroup->addButton(ui->cw_z);
|
||||
|
||||
|
||||
connect(ui->pushButton, SIGNAL(clicked(bool)), this, SLOT(onColorPickerActivate()));
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@ -76,6 +73,8 @@ void MainWindow::addViewer(Viewer* viewer)
|
||||
connect(ui->ccw_z, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjZCCW()));
|
||||
connect(ui->cw_z, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjZCW()));
|
||||
|
||||
connect(ui->actionCel_Shading, SIGNAL(toggled(bool)), viewer, SLOT(toggleCelShading(bool)));
|
||||
|
||||
connect(ui->speedSlider, SIGNAL(valueChanged(int)), viewer, SLOT(animationSpeedChange(int)));
|
||||
connect(ui->play_button, SIGNAL(clicked(bool)), viewer, SLOT(toggleAnimation()));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user