| Support Forum G3D Web Page |
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... | |
A histogram on the surface of a sphere.
Useful for visualizing BSDFs.
The histogram drawn is a smoothing of the actual distribution by a
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.
| G3D::DirectionHistogram::DirectionHistogram | ( | int | numSlices = 50, |
| const Vector3 & | axis = Vector3::unitZ() |
||
| ) |
| axis | place histogram buckets relative to this axis |
| numSlices | Number of lat and long slices to make. |
| 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.
| void G3D::DirectionHistogram::insert | ( | const Array< Vector3 > & | vector, |
| const Array< float > & | weight | ||
| ) |
| 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.
| void G3D::DirectionHistogram::reset | ( | ) |
Discard all data.
1.8.15