# First test of CGE

**URL:** https://forum.castle-engine.io/t/first-test-of-cge/2057
**Category:** Show Your Projects
**Created:** [December 5, 2025, 5:45pm UTC](https://forum.castle-engine.io/t/first-test-of-cge/2057 "2025-12-05T17:45:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aboisrame](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/aboisrame/32/2709_2.png) [@aboisrame](https://forum.castle-engine.io/u/aboisrame)
#### Post date: [December 5, 2025, 5:45pm UTC](https://forum.castle-engine.io/t/first-test-of-cge/2057/1 "2025-12-05T17:45:55Z")

</div>

Hello,

I did start a little project just for me. Polyhedra are build by code from a text file with coordinates and faces definition. It’s the beginning but thanks to CGE to offer such a powerful API 🙂

Alexandre

---

<div class="post-metadata">

### Author: ![aboisrame](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/aboisrame/32/2709_2.png) [@aboisrame](https://forum.castle-engine.io/u/aboisrame)
#### Post date: [December 5, 2025, 5:57pm UTC](https://forum.castle-engine.io/t/first-test-of-cge/2057/2 "2025-12-05T17:57:04Z")

</div>

Things to add :

- 
  1. Can get coordinates of vertices when the polyhdron is moved to be able to save this information in a file

- 
  1. When a polyhedron is in rotation, be able to give the same “movement” the next / previous polyhedron when it is shown.

Did not find any solution for the moment … but madly impressed by what it is already possible to do in just few days after CGE discovery 🙂

---

<div class="post-metadata">

### Author: ![aboisrame](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/aboisrame/32/2709_2.png) [@aboisrame](https://forum.castle-engine.io/u/aboisrame)
#### Post date: [December 9, 2025, 11:59am UTC](https://forum.castle-engine.io/t/first-test-of-cge/2057/3 "2025-12-09T11:59:49Z")

</div>

Edges are now TCylinderNode and vertices are TSphereNode, its’ much better to control how there are build and shown / hidden.

It was not easy to find the right rotation to align each cylinder with to real edge … but dot product and cross product of vectors help me 🙂

Luckily I was a math teacher in my first part of my life 🙂

Thank you again for CGE which is incredible.

Habe a good day

Alexandre

---

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [December 9, 2025, 2:54pm UTC](https://forum.castle-engine.io/t/first-test-of-cge/2057/4 "2025-12-09T14:54:06Z")

</div>

Looks cool!

For cylinders and spheres, if you go into “a lot of them” (like thousands), remember there are ways to make them more optimal:

- You can use “slices” / “stacks” parameters to control how detailed they are. When they are very small, and there are really lots of them, it will be faster to have them less detailed. To do this, change [TSphereNode.Slices](https://castle-engine.io/apidoc/html/X3DNodes.TSphereNode.html#Slices), [TSphereNode.Stacks](https://castle-engine.io/apidoc/html/X3DNodes.TSphereNode.html#Stacks), [TCylinderNode.Slices](https://castle-engine.io/apidoc/html/X3DNodes.TCylinderNode.html#Slices). Or change their global defaults [DefaultTriangulationSlices](https://castle-engine.io/apidoc/html/X3DNodes.html#DefaultTriangulationSlices), [DefaultTriangulationStacks](https://castle-engine.io/apidoc/html/X3DNodes.html#DefaultTriangulationStacks) .

- You may disable rendering of [TCylinderNode.Top](https://castle-engine.io/apidoc/html/X3DNodes.TCylinderNode.html#Top), [TCylinderNode.Bottom](https://castle-engine.io/apidoc/html/X3DNodes.TCylinderNode.html#Bottom) (if cylinder endings are always hidden inside spheres).

- Naturally, the “nuclear” way to speed them up will be also using thick points and thick lines for them, so `TPointSetNode` and `TLineSetNode` with `RenderOptions.LineWidth` and `RenderOptions.PointSize` sufficiently large. This naturally this will look worse than spheres / cylinders 🙂

I don’t know if any of the above advises matter right now, just keep them in mind if you go into larger meshes, like thousands or more vertexes.

---

<div class="post-metadata">

### Author: ![aboisrame](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/aboisrame/32/2709_2.png) [@aboisrame](https://forum.castle-engine.io/u/aboisrame)
#### Post date: [December 9, 2025, 3:52pm UTC](https://forum.castle-engine.io/t/first-test-of-cge/2057/5 "2025-12-09T15:52:15Z")

</div>

Thank you Michalis for your answer.

I have few cylinders/sphres to show but with your anwers I discover again some new classes / methods 🙂 Read CGE documentation is always a interesting travel.

Before use TCylinderNode I did use TIndexedLineSetNode to draw the edges but I finally decided to try to use cylinders to : 1) learn a new thing and find the “good” rotation … and 2) have a better look 🙂

Alexandre
