How do I render a triangle in Godot using C++?

OzzOzz Posts: 5Member

I have already gotten C++ modules to work. But I am having trouble finding the code to render a single triangle. Any help?

Answers

  • ben-gachowskiben-gachowski Posts: 5Member

    MeshDataTool and ArrayMesh allow you to generate mesh data dynamically. MeshDataTool is more abstract and easier to use, ArrayMesh is more low-level.
    You can then add a MeshInstance to the scene, with it's mesh property set to the ArrayMesh you built or the ArrayMesh built from the MeshDataTool. Generating a mesh once and using it multiple times should be pretty efficient, mesh streaming is more difficult to get right.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file