mirror of https://github.com/qt/qt3d.git
Fix off by one error in torus texture coordinate generation
Prevents interpolation from (1-dv) to 0 over the final ring of triangles of the torus. Now we only reach v = 1 at the same point in space where we began creating the torus. Change-Id: I68630c623483bf2993ef24dbef98cca5a9ae26fd Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
This commit is contained in:
parent
2d191d97d3
commit
298c6ebcf6
|
@ -67,7 +67,7 @@ QByteArray createTorusVertexData(double radius, double minorRadius,
|
|||
float* fptr = reinterpret_cast<float*>(bufferBytes.data());
|
||||
|
||||
const float ringFactor = (M_PI * 2) / static_cast<float>( rings );
|
||||
const float sideFactor = (M_PI * 2) / static_cast<float>( sides );
|
||||
const float sideFactor = (M_PI * 2) / static_cast<float>( sides - 1 );
|
||||
|
||||
for (int ring = 0; ring <= rings; ++ring) {
|
||||
const float u = ring * ringFactor;
|
||||
|
|
Loading…
Reference in New Issue