Skip to content

Commit 192e852

Browse files
changed to make model double sided in main
1 parent e6f922f commit 192e852

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ int main(int argc, char **argv)
125125
model->preloadTextures(renderer);
126126
modelExtents = model->getExtents();
127127
modelContainingSphereRadius = max(abs(get<0>(modelExtents)), abs(get<1>(modelExtents)));
128+
for(auto &m : model->meshes)
129+
{
130+
get<1>(m).append(reverse(get<1>(m)));
131+
}
128132
}
129133

130134
double startTime = timer();
@@ -145,7 +149,7 @@ int main(int argc, char **argv)
145149
if(model)
146150
{
147151
float scaleFactor = 1 / max(0.001f, modelContainingSphereRadius);
148-
model->render(renderer, Matrix::translate(0, 0, -2 * scaleFactor * modelContainingSphereRadius), (Matrix::rotateY((time - startTime) / 5 * M_PI)).concat(Matrix::rotateX((time - startTime) / 15 * M_PI)).concat(Matrix::scale(scaleFactor)), Light(VectorF(1, 1, 1)));
152+
model->render(renderer, Matrix::translate(0, 0, -1.2 * scaleFactor * modelContainingSphereRadius), (Matrix::rotateY((time - startTime) / 5 * M_PI)).concat(Matrix::rotateX((time - startTime) / 15 * M_PI)).concat(Matrix::scale(scaleFactor)), Light(VectorF(1, 1, 1)));
149153
}
150154
else
151155
{

0 commit comments

Comments
 (0)