Difference between revisions of "User:Le Forgeron/UVMeshable"

From POV-Wiki
Jump to navigation Jump to search
Line 29: Line 29:
 
* Returns the vertex vector that corresponds to the given uv-coordinates '''uv_vertex( UVMeshableObject, Ucoordinate, Vcoordinate )'''
 
* Returns the vertex vector that corresponds to the given uv-coordinates '''uv_vertex( UVMeshableObject, Ucoordinate, Vcoordinate )'''
 
* Returns the normal vector that corresponds to the given uv-coordinates '''uv_normal( UVMeshableObject, Ucoordinate, Vcoordinate )'''
 
* Returns the normal vector that corresponds to the given uv-coordinates '''uv_normal( UVMeshableObject, Ucoordinate, Vcoordinate )'''
 +
 +
=== Turning UVMeshable into mesh ===
 +
 +
<source lang="pov">
 +
#include "NurbsMesh.inc"
 +
#declare UResolution = 92;
 +
#declare VResolution = 92;
 +
mesh {
 +
    UVMeshable( UVMeshableObject, UResolution, VResolution )
 +
    }
 +
</source>

Revision as of 08:24, 4 July 2018

UVMeshable

A bit of programming

UVMeshable objects are shapes that provides the UVMeshable interface:

class UVMeshable
{
public:
  virtual void evalVertex( VECTOR r, const DBL u, const DBL v )const;
  virtual void evalNormal( VECTOR r, const DBL u, const DBL v )const;
  virtual void minUV( UV_VECT r )const;
  virtual void maxUV( UV_VECT r )const;
};

Which shapes are UVMeshable

So far the following shapes are UVMeshable:

Access to data of UVMeshable objects

  • Returns the minimal uv-coordinates uv_min( UVMeshableObject )
  • Returns the maximal uv-coordinates uv_max( UVMeshableObject )
  • Returns the vertex vector that corresponds to the given uv-coordinates uv_vertex( UVMeshableObject, Ucoordinate, Vcoordinate )
  • Returns the normal vector that corresponds to the given uv-coordinates uv_normal( UVMeshableObject, Ucoordinate, Vcoordinate )

Turning UVMeshable into mesh

#include "NurbsMesh.inc"
#declare UResolution = 92;
#declare VResolution = 92;
mesh {
     UVMeshable( UVMeshableObject, UResolution, VResolution )
     }