Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Construct a complex 3 D object using at least two basic 3 D shapes. The object you construct should replicate one of the

1. Construct a complex 3D object using at least two basic 3D shapes. The object you construct should replicate one of the complex objects from your 2D image. You may want to apply different colors to the 3D shapes to better visualize the different parts of the replicated object. Remember, the following basic 3D shapes are available: use are as follows:
A. Box
B. Cone
C. Cylinder
D. Plane
E. Prism
F. Pyramid
G. Sphere
H. Tapered cylinder
I. Torus
2. Apply transformations so shapes are scaled, rotated, and translated (placed) correctly. This work should be relative to the 2D reference image. For example, if you are working with a cylinder, should it be standing up or lying on its side, based on the image you are referencing? If you are also creating a box, where should you place it relative to the cylinder? What sizes are the two objects when compared to each other? Applying transformations will be easier if you complete these transformations in the right order for your specific object. In general, you should scale first, then rotate, and then translate. Your process will follow this order in most cases, though not always.
3. Create code that follows a logical flow without syntax errors. The code you create needs to be executable. All the code that is included will have to be reached by the execution. You dont need to write everything as a single function. Your work should be well modularized.
4. Apply coding best practices in your creations. Pay particular attention to the way you format and comment your code. Program code should be easy to read and follow industry-standard code formatting practices, such as indentation and spacing. The source code should be brief and clear. Use descriptive comments.
The desktop is the primary form, complemented by a box representing the desktop screen and keyboard. A box depicts the surface of my phone, while a combination of a tapered cylinder and a cylinder represents my jar. The pen on my desk is symbolized by a cylinder and a cone, and a box represents the sticky note.
/***********************************************************
* PrepareScene()
***********************************************************/
void SceneManager::PrepareScene()
{
// only one instance of a particular mesh needs to be
// loaded in memory no matter how many times it is drawn
// in the rendered 3D scene
m_basicMeshes->LoadPlaneMesh();
}
/***********************************************************
* RenderScene()
***********************************************************/
void SceneManager::RenderScene()
{
// declare the variables for the transformations
glm::vec3 scaleXYZ;
float XrotationDegrees =0.0f;
float YrotationDegrees =0.0f;
float ZrotationDegrees =0.0f;
glm::vec3 positionXYZ;
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(20.0f,1.0f,10.0f);
// set the XYZ rotation for the mesh
XrotationDegrees =0.0f;
YrotationDegrees =0.0f;
ZrotationDegrees =0.0f;
// set the XYZ position for the mesh
positionXYZ = glm::vec3(0.0f,0.0f,0.0f);
// set the transformations into memory to be used on the drawn meshes
SetTransformations(
scaleXYZ,
XrotationDegrees,
YrotationDegrees,
ZrotationDegrees,
positionXYZ);
SetShaderColor(1,1,1,1);
// draw the mesh with transformation values
m_basicMeshes->DrawPlaneMesh();
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions