Adventures of The Cube - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Adventures of The Cube

Description:

Construct a 3D object in Matlab (Cube) Create and use Homogenous Coordinates ... Construct the Cube, matrix data. Define matrix of vertices. 8x3 matrix. Define ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 8
Provided by: rolandmi
Learn more at: https://cis.temple.edu
Category:

less

Transcript and Presenter's Notes

Title: Adventures of The Cube


1
Adventures of The Cube
  • Roland Miezianko
  • CIS 581
  • Computer Graphics and Image Processing
  • Prof. Longin Jan Latecki

2
Objective
  • Construct a 3D object in Matlab (Cube)
  • Create and use Homogenous Coordinates
  • Compute all transformations
  • Translation
  • Scaling
  • Rotation x,y,z-axis
  • Flyby

3
Construct the Cube, matrix data
  • Define matrix of vertices
  • 8x3 matrix
  • Define matrix of faces
  • 6x4 matrix
  • Define matrix of vertex and face colors
  • 6x3 matrix

4
Construct the Cube, display
  • Construct cube using the patch command
  • patch('Vertices', v, 'Faces', f,
    'FaceVertexCData', fvc, 'FaceColor', 'flat',
    'EdgeColor', 'none')
  • Set colors to be transparent
  • alpha(.5)

5
Homogeneous Equations
  • Matlab vertices are defined as triplet
  • N x 3 matrix
  • Must add additional column to the vertex matrix
    (N x 4 matrix)
  • Vw v vw'

6
Matrix Operations
  • Matrix operation to translate, scale, and rotate
  • Rotate about x-axis example

rx 1 0 0 0 0 cos(xang) -sin(xang) 0 0 s
in(xang) cos(xang) 0 0 0 0 1 Vw v
vw' Vcomp ( rx Vw )' Vnew Vcomp(,13)
7
The Movie
  • "Adventures of The Cube"
Write a Comment
User Comments (0)
About PowerShow.com