spherical triangles

D31a66e3daa66f418c961ed74ece9b7b
0
kruseborn 101 Mar 19, 2009 at 09:31

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).
normalize(point).
color += image(uv(point));
color /= samples;

4 Replies

Please log in or register to post a reply.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Mar 20, 2009 at 21:31

Hello, fellow Swede!

Is your problem how to tesselate the sphere? The easiest is to use polar coordinates, but a geodesic one will look better.

http://www.gamedev.net/community/forums/topic.asp?topic_id=283350

D31a66e3daa66f418c961ed74ece9b7b
0
kruseborn 101 Mar 23, 2009 at 08:13

@geon

Hello, fellow Swede!

Is your problem how to tesselate the sphere? The easiest is to use polar coordinates, but a geodesic one will look better.

http://www.gamedev.net/community/forums/topic.asp?topic_id=283350

I have some spherical triangles on a sphere and wants the coordinates of all points inside the spherical triangle. Not a normal triangle a spherical one.

I tested this and I think its works

for(int i = 0; i < samples; i++)
    {
        for(int j = 0; j< samples; j++)
        {
            for(int k = 0; k < samples; k++)
            {
                D3DXVECTOR3 p = offset*i*Vvec[0] + offset*j*Vvec[1] + offset*k*Vvec[2];
                               D3DXVec3Normalize(&p, &p);
820ce9018b365a6aeba6e23847f17eda
0
geon 101 Mar 23, 2009 at 13:01

You might be interested in this:

Stratified Sampling of Spherical Triangles

D31a66e3daa66f418c961ed74ece9b7b
0
kruseborn 101 Mar 23, 2009 at 17:07

@geon

You might be interested in this: Stratified Sampling of Spherical Triangles

This was very nice,:) thanks