diff --git a/Segment.cpp b/Segment.cpp index 5adac9b3..e0e367f2 100644 --- a/Segment.cpp +++ b/Segment.cpp @@ -391,7 +391,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori float m1, jmm1, m2, jmm2; // pozycje względne na odcinku 0...1 (ale nie parametr Beziera) step = fStep; - tv1 = 0.0; // Ra: to by można było wyliczać dla odcinka, wyglądało by lepiej + tv1 = 1.0; // Ra: to by można było wyliczać dla odcinka, wyglądało by lepiej s = fStep * iSkip; // iSkip - ile odcinków z początku pominąć int i = iSkip; // domyślnie 0 t = fTsBuffer[ i ]; // tabela wattości t dla segmentów @@ -429,7 +429,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori while( tv1 < 0.0 ) { tv1 += 1.0; } - tv2 = tv1 + step / texturelength; // mapowanie na końcu segmentu + tv2 = tv1 - step / texturelength; // mapowanie na końcu segmentu t = fTsBuffer[ i ]; // szybsze od GetTFromS(s); pos2 = glm::dvec3{ FastGetPoint( t ) - Origin }; @@ -453,7 +453,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori Output.emplace_back( pt, glm::normalize( norm ), - glm::vec2 { 1.f - ( jmm1 * ShapePoints[ j ].texture.x + m1 * ShapePoints[ j + iNumShapePoints ].texture.x ) / texturescale, tv1 } ); + glm::vec2 { ( jmm1 * ShapePoints[ j ].texture.x + m1 * ShapePoints[ j + iNumShapePoints ].texture.x ) / texturescale, tv1 } ); } if( p ) // jeśli jest wskaźnik do tablicy if( *p ) @@ -473,7 +473,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori Output.emplace_back( pt, glm::normalize( norm ), - glm::vec2 { 1.f - ( jmm2 * ShapePoints[ j ].texture.x + m2 * ShapePoints[ j + iNumShapePoints ].texture.x ) / texturescale, tv2 } ); + glm::vec2 { ( jmm2 * ShapePoints[ j ].texture.x + m2 * ShapePoints[ j + iNumShapePoints ].texture.x ) / texturescale, tv2 } ); } if( p ) // jeśli jest wskaźnik do tablicy if( *p ) @@ -497,7 +497,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori Output.emplace_back( pt, glm::normalize( norm ), - glm::vec2 { 1.f - ShapePoints[ j ].texture.x / texturescale, tv1 } ); + glm::vec2 { ShapePoints[ j ].texture.x / texturescale, tv1 } ); pt = parallel2 * ShapePoints[ j ].position.x + pos2; pt.y += ShapePoints[ j ].position.y; @@ -508,7 +508,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori Output.emplace_back( pt, glm::normalize( norm ), - glm::vec2 { 1.f - ShapePoints[ j ].texture.x / texturescale, tv2 } ); + glm::vec2 { ShapePoints[ j ].texture.x / texturescale, tv2 } ); } } }