vertex_to_face_colours: vertex_to_face_colours

Description Usage Arguments Details Value

View source: R/vertex_to_face_colours.R

Description

Convert a vector of vertex colour indexes to a matrix of triangle-vertex-face colour indexes.

Usage

1
vertex_to_face_colours(vertex_colours, faces)

Arguments

vertex_colours

a vector of colours, where each colour represents a colour of a vertex.

faces

a three column matrix of faces described by vertex indicies.

Details

When shading a mesh with colour in the GIS context it is probable that a raster will be used to determine a colour for each vertex. WebVR meshes are shaded at the face level though, so the user is required to provided a mapping to a colour for each vertex in the context of each face.

This function takes a vector of colour indexes and a matrix describing triangle faces using vertex indexes and returns a matrix describing triangle faces using colour indexes.

Value

a matrix with one row per mesh triangle, each column representing a vertex, containing a colour index.


MilesMcBain/r2vr.gis documentation built on May 24, 2019, 7:52 a.m.