Android Question B4A and OpenGL to simulate a 3DPrinter

max123

Well-Known Member
Licensed User
Longtime User
Hi All,

I've developed a Java application capable to open gcode files, parse it line by line, draw a filament on a 3D View, the app can simulate as well 3D printers, CNC Routers and Laser Cutter machines and can connect with these with USB connection and control it manually or by loading a gcode file and execute it on real machine while draw on 3D view.

This application works even on Raspberry PI 3 with original 7 Inches touchscreen or on HDMI monitor, need just to connect the machine with USB cable and Go.

Compatible with Marlin and GRBL firmwares.

As 3D view I've used Java3D library, but now I want to port this application on Android using B4A and I'm a bit confused on how I can do it, because Java3D library works only on desktop machines.

With Java3D I create a cylinder to simulate the filament or just I draw 3D lines to show a CNC router toolpath. For filament I create a cylinder as explained, it is the same size of 3DPrinter Nozzle, the Java3D library create it to Zero position, then I rotate and translate in the right position on the 3D world. The application can even load STL and OBJ files (for future slicing) and can even load an STL file as body of real machine.

My question is, what is the best option to do this on B4A? I need to use Agraham OpenGL library 2.0 and GLSurfaceView?

There are other options? With it I can do all things I explained? Create 3D primitives like Box, Cylinder, sphere, add lights and even import OBJ and STL files?

I never used native OpenGL so this is a bit problematic, Java3D do large use of object oriented, so there are 3DCanvas, BranchGroups, TranformGroups, ViewingPlatform, Shapes3D and others. I searched on the Forum but not tried tutorials on an OpenGL 3D view.

I've attached some screens of my desktop application.

Many thanks for your suggestions ;)

2018-08-21 12_10_37-Greenshot.png
 

Attachments

  • 2018-08-21 20_44_54-Machine body STL file do not exists! Skip loading it and go to next task..png
    2018-08-21 20_44_54-Machine body STL file do not exists! Skip loading it and go to next task..png
    37.8 KB · Views: 562
  • 2018-08-21 20_32_21-Greenshot.png
    2018-08-21 20_32_21-Greenshot.png
    155.9 KB · Views: 557
  • 2018-08-21 20_33_48-Greenshot.png
    2018-08-21 20_33_48-Greenshot.png
    130.9 KB · Views: 506
  • 2018-08-21 20_36_35-Current File_  monochromatic_small.gcode   -   WORKING.png
    2018-08-21 20_36_35-Current File_ monochromatic_small.gcode - WORKING.png
    68.4 KB · Views: 489
  • 2018-07-20 16_18_57-Greenshot.png
    2018-07-20 16_18_57-Greenshot.png
    390.3 KB · Views: 553
  • 2018-07-20 16_55_29-Greenshot.png
    2018-07-20 16_55_29-Greenshot.png
    191.3 KB · Views: 560
  • 2018-07-20 16_59_19-Greenshot.png
    2018-07-20 16_59_19-Greenshot.png
    249.7 KB · Views: 592
  • 2018-08-06 19_00_33-Greenshot.png
    2018-08-06 19_00_33-Greenshot.png
    439.7 KB · Views: 575
  • 2018-08-18 15_24_47-Greenshot.png
    2018-08-18 15_24_47-Greenshot.png
    206.9 KB · Views: 518
  • 2018-08-18 15_50_52-Greenshot.png
    2018-08-18 15_50_52-Greenshot.png
    464.6 KB · Views: 517
  • 2018-08-18 15_52_09-Greenshot.png
    2018-08-18 15_52_09-Greenshot.png
    319.2 KB · Views: 514
  • 2018-08-18 16_12_33-Greenshot.png
    2018-08-18 16_12_33-Greenshot.png
    287.9 KB · Views: 524
  • 2018-08-19 21_54_41-Greenshot.png
    2018-08-19 21_54_41-Greenshot.png
    266.7 KB · Views: 981
  • 2018-08-19 21_56_23-Greenshot.png
    2018-08-19 21_56_23-Greenshot.png
    502.5 KB · Views: 493
  • 2018-08-19 22_02_02-Greenshot.png
    2018-08-19 22_02_02-Greenshot.png
    489.8 KB · Views: 504
  • 2018-08-19 22_04_01-Greenshot.png
    2018-08-19 22_04_01-Greenshot.png
    189.1 KB · Views: 551
  • 36944784_1984999961510253_6248535257939705856_n.png
    36944784_1984999961510253_6248535257939705856_n.png
    190.5 KB · Views: 462
  • 37000394_1989946537682262_1240523551656640512_n.png
    37000394_1989946537682262_1240523551656640512_n.png
    337.3 KB · Views: 485
  • 37065058_1989946464348936_1785047197729947648_n.png
    37065058_1989946464348936_1785047197729947648_n.png
    294.8 KB · Views: 483
Last edited:

max123

Well-Known Member
Licensed User
Longtime User
Hi @alienhunter, sorry for long delay on reply, I developed it directly on Java and then on Jabaco, this because Java3D use Swing.

A port for B4J I think also is possible bypassing JavaFX and may use NONUI app to create a Swing frame, even JavaFX has some methods to accomodate Swing views on JavaFX forms, but is no so simple to do.

Java3D is powerful, but require a videocard with native support of OpenGL or DirectX, I've an old singlecore PC with ATI videocard and 3D works very well, I've another dualcore PC with Intel videocard integrated on the mainboard and 3D is very slow on this machine.

If you (or other users) want to test Java3D (maybe to port on B4J) I've some Java code tests and I can publish here on the forum. Using JavaObject maybe is possible that works.

Regards
 
Last edited:
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
Hi @alienhunter, sorry for long delay on reply, I developed it directly on Java and then on Jabaco, this because Java3D use Swing.

A port for B4J I think also is possible bypassing JavaFX and maybe use NONUI app to create a Swing frame, even JavaFX has some methods to accomodate Swing views on JavaFX forms, but is no so simple to do.

Java3D is powerful, but require a videocard with native support of OpenGL or DirectX, I've an old singlecore PC with ATI videocard and 3D works very well, I've another dualcore PC with Intel videocard integrated on the mainboard and 3D is very slow on this machine.

If you (or other users) want to test Java3D (maybe to port on B4J) I've some Java code tests and I can publish here on the forum. Using JavaObject maybe is possible that works.

Regards

Thanks
would be nice to test the Java 3D to see this working, if you got time
Jabaco... something new thanks

AH
 
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Yes, please tell me time to prepare some material and tutorials and I post it here on this forum.

Many thanks for your interest. ;)
 
Upvote 0
Top