Question: How do I make the battleship in open gl look like an acutally battleship and how do i make the ocean look even? / *

How do I make the battleship in open gl look like an acutally battleship and how do i make the ocean look even?
/*ANSWER*/GLfloat ship_vertices[]={
2.5f,-0.5f,0.0f,//0
-1.5f,-0.5f,0.5f,//1
-0.5f,0.5f,0.0f,//2
0.5f,0.5f,0.0f,//3
1.5f,-0.5f,0.5f,//4
2.5f,-0.5f,0.0f,//5
0.0f,-0.5f,2.5f //6(center)
};
// Note: you can keep these ship_colors if you want...
GLfloat ocean_surface_colors[]={
0.0f,0.0f,0.7f,1.0f,// Dark Blue
0.0f,0.0f,0.7f,1.0f,// Dark Blue
0.0f,0.0f,1.0f,1.0f,// Light Blue
0.0f,0.0f,1.0f,1.0f // Light Blue
};
/*ANSWER*/GLfloat ship_colors[]={// this is the new array of ship_colors, simply truncated
0.1f,0.1f,0.1f,1.0f,// Dark gray
0.1f,0.1f,0.1f,1.0f,
0.2f,0.2f,0.2f,1.0f,// Slightly lighter gray
0.2f,0.2f,0.2f,1.0f,
0.1f,0.1f,0.1f,1.0f,
0.1f,0.1f,0.1f,1.0f,
0.3f,0.3f,0.3f,1.0f // Light gray for the center part
};
//2) Create an array of ship_indices of triangles. This should have 9 numbers (think about why)
/*ANSWER*/GLuint ship_indices[]={
0,1,2,
2,3,4,
1,5,4,
1,0,6,
2,4,3,
0,2,6,
3,5,4,
0,1,6,
1,5,6,
2,3,6,
3,4,6
};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!