Skip to content

Conversation

@zommerfelds
Copy link

The current example looks like an accidental copy paste without adapting the code. I fixed that and made the C# version more consistent.


.. code-tab:: csharp

# Suppose we have a quad defined by 6 vertices as follows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Suppose we have a quad defined by 6 vertices as follows
// Suppose we have a quad defined by 6 vertices as follows.

st.AddVertex(Vector3(1, -1, 0));
st.AddVertex(Vector3(-1, -1, 0));

# We can make the quad more efficient by using an index array and only utilizing 4 vertices:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# We can make the quad more efficient by using an index array and only utilizing 4 vertices:
// We can make the quad more efficient by using an index array and only utilizing 4 vertices:

Comment on lines +148 to +154
st.AddVertex(Vector3(-1, 1, 0));
st.AddVertex(Vector3(1, 1, 0));
st.AddVertex(Vector3(-1, -1, 0));

st.AddVertex(Vector3(1, 1, 0));
st.AddVertex(Vector3(1, -1, 0));
st.AddVertex(Vector3(-1, -1, 0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
st.AddVertex(Vector3(-1, 1, 0));
st.AddVertex(Vector3(1, 1, 0));
st.AddVertex(Vector3(-1, -1, 0));
st.AddVertex(Vector3(1, 1, 0));
st.AddVertex(Vector3(1, -1, 0));
st.AddVertex(Vector3(-1, -1, 0));
st.AddVertex(new Vector3(-1, 1, 0));
st.AddVertex(new Vector3(1, 1, 0));
st.AddVertex(new Vector3(-1, -1, 0));
st.AddVertex(new Vector3(1, 1, 0));
st.AddVertex(new Vector3(1, -1, 0));
st.AddVertex(new Vector3(-1, -1, 0));

st.AddIndex(2);

// Alternatively:
// Alternatively we can use `st.Index()` which will create the quad for us and remove the duplicate vertices
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Alternatively we can use `st.Index()` which will create the quad for us and remove the duplicate vertices
// Alternatively we can use `st.Index()` which will create the quad for us and remove the duplicate vertices.

@AThousandShips AThousandShips added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants