Jump to content

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

Featured Replies

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

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.