Jump to content

What is the best tools/method to draw honeycombs(hexagon)?


PeterBushMan

Recommended Posts

1 hour ago, PeterBushMan said:

What is the best tools/method to draw honeycombs(hexagon)?

Where?

In a 3D app?

In OpenGL/Direct3D?

In the Unity/Unreal etc. game engine?

In C/C++/C#/Java etc. ?

 

C/C++ code:

void moveTo( int x, int y ) {
   // fill me
}
void lineTo( int x, int y ) {
   // fill me
}
void hexagon( int x, int y, int radius ) {
   for( int i = 0; i < 6; i++ ) {
      double angle1 = 2.0 * M_PI * 360.0 * i / 6;
      double angle2 = 2.0 * M_PI * 360.0 * ( i + 1 ) / 6;
      moveTo( x + sin( angle1 ) * radius, y + cos( angle1 ) * radius );
      lineTo( x + sin( angle2 ) * radius, y + cos( angle2 ) * radius );
   }
}

 

In the 3D application. I used the Sphere tool, set Z to 0 to have a circle, changed the number of segments to 6, and then used the Array tool:

Honeycomb.png.95b04a7d9cb45ecb7e8d1190d9874097.png

Edited by Sensei
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.