I have a unit sphere partition in to spherical triangles. For every triangle have a three positions, (xyz), (xyz) and (xyz). Now i want to step throw all the points on the triangles and then convert them to texture coordinates on a cube map.
Converting worlds positions to cube maps position i got working but stepping throw all positions on a spherical triangle i have hard time doing for a given resolution.
Now I am using some random samples for every triangle.
point = weight1*(point1)+weight2*(point2)+weight3*(point3).
color += image(uv(point));
color /= samples;