Answered step by step
Verified Expert Solution
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
Construct a complex D object using at least two basic D shapes. The object you construct should replicate one of the complex objects from your D image. You may want to apply different colors to the D shapes to better visualize the different parts of the replicated object. Remember, the following basic D 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
Apply transformations so shapes are scaled, rotated, and translated placed correctly. This work should be relative to the D 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.
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.
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 industrystandard 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 D scene
mbasicMeshesLoadPlaneMesh;
RenderScene
void SceneManager::RenderScene
declare the variables for the transformations
glm::vec scaleXYZ;
float XrotationDegrees f;
float YrotationDegrees f;
float ZrotationDegrees f;
glm::vec positionXYZ;
set the XYZ scale for the mesh
scaleXYZ glm::vecfff;
set the XYZ rotation for the mesh
XrotationDegrees f;
YrotationDegrees f;
ZrotationDegrees f;
set the XYZ position for the mesh
positionXYZ glm::vecfff;
set the transformations into memory to be used on the drawn meshes
SetTransformations
scaleXYZ,
XrotationDegrees,
YrotationDegrees,
ZrotationDegrees,
positionXYZ;
SetShaderColor;
draw the mesh with transformation values
mbasicMeshesDrawPlaneMesh;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started