Support Forum       G3D Web Page     
Classes | Public Member Functions | Static Private Member Functions | List of all members
G3D::DirectionHistogram Class Reference

A histogram on the surface of a sphere. More...

Inherits G3D::ReferenceCountedObject.

Public Member Functions

 DirectionHistogram (int numSlices=50, const Vector3 &axis=Vector3::unitZ())
 
void insert (const Vector3 &vector, float weight=1.0f)
 
Insert a new data point into the set. More...
 
void insert (const Array< Vector3 > &vector, const Array< float > &weight)
 
void render (class RenderDevice *rd, const Color3 &solidColor=Color3::white(), const Color4 &lineColor=Color3::black())
 Draw a wireframe of the distribution. More...
 
void reset ()
 Discard all data. More...
 

Static Private Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

A histogram on the surface of a sphere.

Useful for visualizing BSDFs.

The histogram drawn is a smoothing of the actual distribution by a $ \cos^{sharp} $ filter to ensure that it is not undersampled by the underlying histogram mesh and buckets.

Storage size is constant in the amount of data. Input is immediately inserted into a bucket and then discarded.

Constructor & Destructor Documentation

◆ DirectionHistogram()

G3D::DirectionHistogram::DirectionHistogram ( int  numSlices = 50,
const Vector3 axis = Vector3::unitZ() 
)
Parameters
axisplace histogram buckets relative to this axis
numSlicesNumber of lat and long slices to make.

Member Function Documentation

◆ insert() [1/2]

void G3D::DirectionHistogram::insert ( const Vector3 vector,
float  weight = 1.0f 
)


Insert a new data point into the set.

Only the direction of vector matters; it will be normalized.

◆ insert() [2/2]

void G3D::DirectionHistogram::insert ( const Array< Vector3 > &  vector,
const Array< float > &  weight 
)

◆ render()

void G3D::DirectionHistogram::render ( class RenderDevice rd,
const Color3 solidColor = Color3::white(),
const Color4 lineColor = Color3::black() 
)

Draw a wireframe of the distribution.

Renders with approximately constant volume.

◆ reset()

void G3D::DirectionHistogram::reset ( )

Discard all data.


documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15