PhotoGENius V1.0.0
A basic library for generating photorealistic images, developed for the course Numerical techniques for photorealistic image generation.
Public Member Functions | List of all members
PGENLib.Sphere Class Reference

A 3D unit sphere centered on the axes origin. More...

Inheritance diagram for PGENLib.Sphere:
PGENLib.Shape

Public Member Functions

 Sphere (Transformation transf, Material material)
 
 Sphere (Material material)
 
 Sphere (Transformation transformation)
 
override? HitRecord RayIntersection (Ray ray)
 Compute the intersection between a ray and the shape. More...
 
override bool QuickRayIntersection (Ray ray)
 Determine whether a ray hits the shape or not More...
 
Normal SphereNormal (Point point, Vec dir)
 Computes the normal in the intersection point of a ray and the surface of a unit sphere. The normal has always the opposite direction with respect to a given Ray. More...
 
Vec2d SpherePointToUv (Point point)
 Convert the 3D intersection point into a 2D point, of coordinates (u,v). More...
 
virtual ? HitRecord RayIntersection (Ray ray)
 Compute the intersection between a ray and a shape More...
 
virtual bool QuickRayIntersection (Ray ray)
 Determine whether a ray hits the shape or not More...
 

Additional Inherited Members

- Public Attributes inherited from PGENLib.Shape
Transformation Transf
 
Material Material
 

Detailed Description

A 3D unit sphere centered on the axes origin.

Member Function Documentation

◆ QuickRayIntersection()

override bool PGENLib.Sphere.QuickRayIntersection ( Ray  ray)
virtual

Determine whether a ray hits the shape or not

Parameters
ray
Returns
Exceptions
NotImplementedException

Reimplemented from PGENLib.Shape.

◆ RayIntersection()

override? HitRecord PGENLib.Sphere.RayIntersection ( Ray  ray)
virtual

Compute the intersection between a ray and the shape.

Parameters
ray
Returns
Returns a HitRecord, or Null if the ray doesn't hit the sphere.

Reimplemented from PGENLib.Shape.

◆ SphereNormal()

Normal PGENLib.Sphere.SphereNormal ( Point  point,
Vec  dir 
)

Computes the normal in the intersection point of a ray and the surface of a unit sphere. The normal has always the opposite direction with respect to a given Ray.

Parameters
pointType Point
dirType Vec
Returns
Normal

◆ SpherePointToUv()

Vec2d PGENLib.Sphere.SpherePointToUv ( Point  point)

Convert the 3D intersection point into a 2D point, of coordinates (u,v).

Parameters
point
Returns
Vec2d

The documentation for this class was generated from the following file: