How to plot a parallelepiped ?
182 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
how to plot a parallelepiped or any 3d shape and perform transformation about the xy plane
0 comentarios
Respuestas (1)
Walter Roberson
el 19 de Oct. de 2017
I recommend constructing a list of vertexes, and a list of face connections (information on how the vertices connect), and use patch() to draw them. Be sure to be consistent on the order of vertices so that whether a side is inside or outside can be determined for lighting purposes. I keep forgetting the convention but my memory is whispering counter-clockwise.
From there, rotation and reflection and sheer can be done by updating the vertex information. However other ways can be more convenient.
One approach is to create a hgtransform and use it as the parent object for the graphic object to be transformed. Then you can set the hgtransform transform matrix property or you can use makehgtform to create a the matrix.
hgtransform group can be used to transform even "flat" graphics objects such as images or such as to move contour plots in 3 space.
0 comentarios
Ver también
Categorías
Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!