mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Fixed string braided normals.
This commit is contained in:
parent
4f549e9163
commit
b4448e2d63
1 changed files with 7 additions and 3 deletions
|
@ -572,6 +572,8 @@ void lcSynthInfo::AddStringBraidedParts(lcMemFile& File, lcLibraryMeshData& Mesh
|
|||
lcVector3 Vertex = (lcMul(Vertex1, Transform1) + Offset1) * (1.0f - t) + (lcMul(Vertex2, Transform2) + Offset2) * t;
|
||||
|
||||
VertexBuffer->Position = Vertex;
|
||||
VertexBuffer->Normal = lcVector3(0.0f, 0.0f, 0.0f);
|
||||
VertexBuffer->NormalWeight = 0.0f;
|
||||
VertexBuffer++;
|
||||
|
||||
if (SegmentIdx != NumSegments)
|
||||
|
@ -607,10 +609,12 @@ void lcSynthInfo::AddStringBraidedParts(lcMemFile& File, lcLibraryMeshData& Mesh
|
|||
{
|
||||
lcVector3 Vertex11 = lcVector3(t1 * 4.0f, PositionTable[(BaseX + SliceIdx) % NumSlices], PositionTable[(BaseY + SliceIdx) % NumSlices]) + lcVector3(0.0f, 1.5f, 0.0f);
|
||||
lcVector3 Vertex12 = lcVector3((1.0f - t1) * -4.0f, PositionTable[(BaseX + SliceIdx) % NumSlices], PositionTable[(BaseY + SliceIdx) % NumSlices]) + lcVector3(0.0f, 1.5f, 0.0f);
|
||||
VertexBuffer->Position = (lcMul(Vertex11, Transform1) + Offset1) * (1.0f - t1) + (lcMul(Vertex12, Transform2) + Offset2) * t1;
|
||||
|
||||
lcVector3 Vertex1 = (lcMul(Vertex11, Transform1) + Offset1) * (1.0f - t1) + (lcMul(Vertex12, Transform2) + Offset2) * t1;
|
||||
|
||||
VertexBuffer->Position = Vertex1;
|
||||
lcVector3 Normal11 = lcVector3(0.0f, PositionTable[(BaseX + SliceIdx) % NumSlices] / 1.5f, PositionTable[(BaseY + SliceIdx) % NumSlices] / 1.5f);
|
||||
lcVector3 Normal12 = lcVector3(0.0f, PositionTable[(BaseX + SliceIdx) % NumSlices] / 1.5f, PositionTable[(BaseY + SliceIdx) % NumSlices] / 1.5f);
|
||||
VertexBuffer->Normal = lcMul(Normal11, Transform1) * (1.0f - t1) + lcMul(Normal12, Transform2) * t1;
|
||||
VertexBuffer->NormalWeight = 1.0f;
|
||||
VertexBuffer++;
|
||||
|
||||
if (SegmentIdx != NumSegments)
|
||||
|
|
Loading…
Add table
Reference in a new issue