Difference between revisions of "User:Le Forgeron/UVMeshable"
Jump to navigation
Jump to search
Le Forgeron (talk | contribs) |
Le Forgeron (talk | contribs) |
||
Line 45: | Line 45: | ||
} | } | ||
</source> | </source> | ||
− | + | <gallery> | |
− | + | image:LeForgeronUVMeshableCone.png | |
− | + | image:LeForgeronUVMeshableCylinder.png | |
− | + | image:LeForgeronUVMeshableLemon.png | |
− | + | image:LeForgeronUVMeshableOvus.png | |
− | + | image:LeForgeronUVMeshableSphere.png | |
− | + | image:LeForgeronUVMeshableTorus.png | |
− | + | </gallery> | |
− | |||
− | |||
− | |||
− |
Revision as of 21:36, 29 August 2018
- Everything about HgPovray38 in User:Le_Forgeron/HgPovray38
- Code is available on branch hgpovray38 at https://github.com/LeForgeron/povray
UVMeshable
A bit of programming
UVMeshable objects are shapes that provides the UVMeshable interface:
class UVMeshable
{
public:
virtual void evalVertex( Vector3d& r, const DBL u, const DBL v )const;
virtual void evalNormal( Vector3d& r, const DBL u, const DBL v )const;
virtual void minUV( Vector2d& r )const;
virtual void maxUV( Vector2d& r )const;
};
Which shapes are UVMeshable
So far the following shapes are UVMeshable:
nurbs
(see User:Le_Forgeron/nurbs)rational_bezier_patch
(see User:Le_Forgeron/rational_bezier_patch)sphere
cone
cylinder
ovus
lemon
torus
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 )
}