
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Topic Video
Question
Complete the above given python starter code for a jupyter notebook based off project description.

Transcribed Image Text:Generating a World to Camera Transformation
To visualize the 3D body model, we will render it from a desired camera viewpoint, by filling in
the values of a rigid transformation relating camera to world. This transformation task is likely
to be the easiest, because it directly corresponds to a procedure we talked about in class and that
also appears in the textbook in the chapter on Viewing. Choose an eye position (camera location
in world coordinates), a gaze direction (aka look direction vector), and an up direction that in
this case will be the positive Z axis of the world, just follow the procedure that generates the
translation and rotation matrices that form the World to Camera (canonical to frame) change of
basis transformation.
Due to our earlier normalization of the body into a predetermined location and orientation, we are
more easily able to specify a camera viewpoint that is meaningful relative to the body. For example,
if we place the camera on the positive Y axis of the world, looking back along the negative Y axis
towards the origin, we should see a frontal view of the body. Similarly, if the camera is on the
positive X axis of the world looking back along the negative X axis towards the origin, we should
see the right side of the body. And so on.
This is a good time to remind you that we want you to compute the numerical entries of the rotation
and translation matrices yourself, using numpy and linear algebra ideas that we have been going
over in lectures. Pytorch3D has a function called "look_at_view_transform". Do not use that
function. We may use such higher level, more efficient functions in future projects, but the whole
point of this project is to understand how to specify the geometric transformations ourselves, at a
fundamental level of detail.
For that matter, you are cautioned that Pytorch3D represents points as row vectors, and therefore
when it makes a transformation matrix, it is the transpose of how we defined things.
![# create a default 4x4 homogeneous transform matrix
Mcam = np.zeros((4, 4))
Mcam [0,0] = 1.0
Mcam [1, 2] = 1.0
Mcam [2,1] = -1.0
Mcam [2,3]
30.0;
=
Mcam[3,3] = 1.0
# Your job is to fill matrix Mcam in properly, given an eye position,
# a lookat vector (e.g. looking towards a point on the object), and
# an up vector (in our case, the world +Z axis)
EyeXYZ = []
LookAtXYZ = []
UpVector = np.array ( [0.,0.,1.])
#add your code here
#print out the transformation matrix
print('Mcam transformation matrix is: ')
print (Mcam)
Mcam transformation matrix is:
[[ 1. 0. 0. 0.]
[ 0. 0. 1. 0.]
[ 0. -1.
0. 30.]
[ 0. 0. 0.
1.]]](https://content.bartleby.com/qna-images/question/ce5bedbe-2eea-47bf-ad25-c78fc8337ba4/3c6d847f-79af-4a11-8945-240e9239412e/1z8sqm_thumbnail.png)
Transcribed Image Text:# create a default 4x4 homogeneous transform matrix
Mcam = np.zeros((4, 4))
Mcam [0,0] = 1.0
Mcam [1, 2] = 1.0
Mcam [2,1] = -1.0
Mcam [2,3]
30.0;
=
Mcam[3,3] = 1.0
# Your job is to fill matrix Mcam in properly, given an eye position,
# a lookat vector (e.g. looking towards a point on the object), and
# an up vector (in our case, the world +Z axis)
EyeXYZ = []
LookAtXYZ = []
UpVector = np.array ( [0.,0.,1.])
#add your code here
#print out the transformation matrix
print('Mcam transformation matrix is: ')
print (Mcam)
Mcam transformation matrix is:
[[ 1. 0. 0. 0.]
[ 0. 0. 1. 0.]
[ 0. -1.
0. 30.]
[ 0. 0. 0.
1.]]
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 5 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- how to write a python program - 1. Read the initial grid specifications from the input text file and create a 2-dimensional list structure to represent the grid.2. Implement a function to display the current state of the grid on the console.3. Implement the command processing logic to move Pacman on the grid according to the user's input.4. Update the grid state based on the user's input and display the updated grid.5. Repeat step 3 and 4 until the user chooses to quit the game.arrow_forwardFor this homework assignment you are not allowed to use::MOVSB, MOVSW, MOVSD, CMPSB,CMPSW,CMPD,SCASB, SCASW, SCASD,STOSB, STOSW, STOSD, LODSB, LODSW, and LODSD. It is required that for each question write only one procedure that does the requested job. Only write the assembly part and avoid using directives. DO NOT USE IRVINE'S LIBRARY. Write a general-purpose program (only assembly code and no procedure call) that inserts a source string to the beginning of a target string. Sufficient space must exist in the target string to accommodate the new characters. Here is a sample call:.datatargetStr BYTE "Stanford",30 DUP(0)sourceStr BYTE "Kamran ",0.codearrow_forwardCan you tell us more about the compiler and possible testing methods?arrow_forward
- Explain the idea of testability in further detail, and if it's not too much difficulty, give us a high-level overview of the compiler.arrow_forwardIt would be really useful if you could provide a brief summary of the compiler and offer some thoughts on whether or not the code can be tested.arrow_forwardThis course will cover testability and quickly explain the compiler.arrow_forward
- For this homework assignment you are not allowed to use::MOVSB, MOVSW, MOVSD, CMPSB,CMPSW,CMPD,SCASB, SCASW, SCASD,STOSB, STOSW, STOSD, LODSB, LODSW, and LODSD. It is required that for each question write only one procedure that does the requested job. Only write the assembly part and avoid using directives. DO NOT USE IRVINE'S LIBRARY.Write a general-purpose program (only assembly code and no procedure call) that corrects two extra successive mistakenly entered characters that happened twice in a string. For example, in “Excellent time tooo listen to muuusic” program should remove the extra double oo and uu. Here is a sample call:. datastr1 BYTE “Excellent time tooo listen to muuusic”,0.codearrow_forwardIn this course, you will get an overview of the compiler and go through the testability tip.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education