Skip to content

Instantly share code, notes, and snippets.

@edecoux
Last active September 3, 2022 23:34
Show Gist options
  • Select an option

  • Save edecoux/468cb2f8079835b76d2f28fa5d21604f to your computer and use it in GitHub Desktop.

Select an option

Save edecoux/468cb2f8079835b76d2f28fa5d21604f to your computer and use it in GitHub Desktop.
3D projection.md

3D projection on a 2D plane

https://share.summari.com/questions23057923d-projection-on-a-2d-plane-weak-maths-ressources?utm_source=Mobile

  • based on optics, and (linear) algebra
  • Do not bother with Euler angles or Tait-Bryan angles
  • Learn about versors or unit quaternions that represent rotations
  • You can easily interpolate between different versors, for example to simulate a camera panning and rotating from one orientation to the next
  • For computation, you expand (convert) the versor to a 3×3 rotation matrix

3D projection on a 2D plane ( weak maths ressources )

https://math.stackexchange.com/questions/2305792/3d-projection-on-a-2d-plane-weak-maths-ressources?utm_source=summari

  • familiarize yourself with basic 2D and 3D vector algebra. Using vector addition, subtraction, scaling, dot product, and cross product, many of the operations you need to work with 3D worlds become much simpler.

  • learn about versors, or unit quaternions that represent rotations. They have four components

  • You can easily interpolate ("blend") between different versors, for example to simulate a camera panning and rotating from one orientation to the next.

  • quaternions have a reputation (among programmers) of being hard to grok, their unit quaternion or versor subset is actually very programmer-friendly.

  • They are numerically stable divide the component to scale it back to unit length, and it won't bias the rotation in any specific way).

  • For computation, you expand (convert) the versor to a 3×3 rotation matrix

  • learn about matrix-matrix multiplication, and matrix-vector multiplication, so that you can efficiently apply the rotations to vectors.

  • Matrix-matrix multiplication is used to combine rotations or transformations described by matrices, to other such matrices.

  • you only need to use one matrix to transform any vector, but that matrix can be the result of several different transformations itself.

  • Versor-versor multiplication (Hamilton product)

  • The reverse problem, trying to find the object and the point on an object, when you know the ray arriving at the eye, is called ray casting.

  • If you then continue to trace the possible rays, to find out which ones might originate in light sources, you get to ray tracing.

  • transform the 3D coordinate system so that your eye (or camera) is always at origin, the intersection tests become much easier.

3D projection

3D projection

  • Graphical projection is a protocol
  • an image of a three-dimensional object is projected onto a planar surface without the aid of numerical calculation.
  • current methods for displaying graphical data are based on planar (pixel information from several bitplanes) two-dimensional media, the use of this type of projection is widespread
  • projection is achieved by the use of virtual "projectors"
  • There are two graphical projection categories each with its own protocol:
    • parallel projection,
    • perspective projection and
    • oblique projection

Parallel projection

  • corresponds to a perspective projection with a hypothetical viewpoint
  • the lines of sight from the object to the projection plane are parallel to each other.
  • rely upon the technique of axonometry.
  • the resulting image is oblique (the rays are not perpendicular to the image plane).

Orthographic projection

  • derived from the principles of descriptive geometry
  • is a two-dimensional representation of a three-dimensional object.
  • It is a parallel projection (the lines of projection are parallel both in reality and in the projection plane).
  • Parallel lengths at all points in an orthographically projected image are of the same scale regardless of whether they are far away or near to the virtual viewer.

Multiview projection

  • up to six pictures (called primary views) of an object are produced, with each projection plane parallel to one of the coordinate axes of the object.
  • views are positioned relative to each other according to either of two schemes: first-angle or third-angle projection.

Axonometric projection

  • an image of an object as viewed from a skew direction
  • reveal all three directions of space in one picture
  • approximate graphical perspective projections, but there is attendant distortion in the approximation
  • Differentiates into isometric projection, dimetric projection and trimetric projection

Isometric projection

  • The direction of viewing is such that the three axes of space appear equally foreshortened, and there is a common angle of 120° between them

Dimetric projection

  • the direction of viewing is such that two of the three axes of space appear equally foreshortened
  • the attendant scale and angles of presentation are determined according to the angle of viewing; the scale of the third direction (vertical) is determined separately.

Trimetric projection

  • the direction of viewing is such that all of the three axes of space appear unequally foreshortened.
  • The scale along each of the axes and the angles among them are determined separately as dictated by the angle of viewing.

Oblique projection

  • Parallel projection rays are not perpendicular to the viewing plane as with orthographic projection, but strike the projection plane at an angle other than ninety degrees.
  • oblique projection is used exclusively for pictorial purposes

Cavalier projection

  • sometimes cavalier perspective or high view point
  • a point of the object is represented by three coordinates, x, y, and z.
  • On the flat drawing, two axes, x and z on the figure, are perpendicular
  • the length on these axes are drawn with a 1:1 scale.

Military projection

  • A variant of oblique projection.
  • the horizontal sections are isometrically drawn
  • the floor plans are not distorted and the verticals are drawn at an angle.

Limitations of Parallel projection

  • Objects drawn with parallel projection do not appear larger or smaller as they extend closer to or away from the viewer.
  • the result is a perceived distortion
  • unlike perspective projection, this is not how our eyes or photography normally work.

Perspective projection

  • A linear projection
  • three dimensional objects are projected on a picture plane.
  • Distant objects appear smaller than nearer objects
  • lines which are parallel in nature converge to a single point, called the vanishing point (P.V.)
  • categorized into one-point, two-point and three-point perspective, depending on the orientation of the projection plane towards the axes of the depicted object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment