ChatSD also managed touch
AI it's interesting and I use it a lot, but I can say that it is useful for creating small parts of a code. A complex query or solve some problems in known languages.
B4J code generated by ChatGPT (it only failed to handle arrow key press events).
Yes, in fact it was an answer to ChatGPT. It's still not at chatSD level
I know your skills in this area, @Star-Dust, but mine are much poorer. Note that I was not interested in getting something usable, I just wanted to test out ChatGPT's capabilities.
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Timer1 As Timer
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
' Create a 3D sphere
Dim sphere As JavaObject
sphere.InitializeNewInstance("javafx.scene.shape.Sphere", Array(100)) ' 100 is the radius of the sphere
' Create a 3D scene
Dim scene As JavaObject
scene.InitializeNewInstance("javafx.scene.Scene", Array(MainForm.RootPane, 800, 600, True))
scene.RunMethod("setFill", Array(fx.Colors.White))
' Add the sphere to the scene
Dim root As JavaObject = scene.RunMethod("getRoot", Null)
root.RunMethod("getChildren", Null).RunMethod("add", Array(sphere))
' Create a PointLight
Dim pointLight As JavaObject
pointLight.InitializeNewInstance("javafx.scene.PointLight", Null)
pointLight.RunMethod("setColor", Array(fx.Colors.White))
pointLight.RunMethod("setTranslateX", Array(200))
pointLight.RunMethod("setTranslateY", Array(-100))
pointLight.RunMethod("setTranslateZ", Array(-300))
' Add the light to the scene
root.RunMethod("getChildren", Null).RunMethod("add", Array(pointLight))
' Set the scene to the form
MainForm.RootPane.RunMethod("setScene", Array(scene))
' Create a RotateTransition for the sphere
Dim rotateTransition As JavaObject
rotateTransition.InitializeNewInstance("javafx.animation.RotateTransition", Array(2000, sphere)) ' 2000 ms duration
rotateTransition.RunMethod("setByAngle", Array(360)) ' Rotate by 360 degrees
rotateTransition.RunMethod("setCycleCount", Array(-1)) ' Infinite loop
rotateTransition.RunMethod("setAutoReverse", Array(False))
' Start the rotation
rotateTransition.RunMethod("play", Null)
End Sub
Nothing (I think it's just a gift for @Star-Dust )Don't know what it has done with the Timer.....
Many errors.This is what Copilot gives me when asked to draw a 3D sphere in B4J and to rotate it. Have not tried it in a B4J project
I am sure that with a bit of effort one could turn this into a 3D rotating sphere.Many errors.
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
' Create a 3D sphere
Dim sphere As JavaObject
sphere.InitializeNewInstance("javafx.scene.shape.Sphere", Array(100.00)) ' 100 is the radius of the sphere
' Add the sphere to the scene
MainForm.RootPane.AddNode(sphere,300,300,-1,-1)
' Create a PointLight
Dim pointLight As JavaObject
pointLight.InitializeNewInstance("javafx.scene.PointLight", Null)
pointLight.RunMethod("setColor", Array(fx.Colors.blue))
pointLight.RunMethod("setTranslateX", Array(200.0))
pointLight.RunMethod("setTranslateY", Array(-100.0))
pointLight.RunMethod("setTranslateZ", Array(-600.0))
' Add the light to the scene
MainForm.RootPane.AddNode(pointLight,300,300,-1,-1)
' Set the scene to the form
'MainForm.RootPane.RunMethod("setScene", Array(scene))
' Create a RotateTransition for the sphere
' Dim rotateTransition As JavaObject
' rotateTransition.InitializeNewInstance("javafx.animation.RotateTransition", Array(2000, sphere)) ' 2000 ms duration
' rotateTransition.RunMethod("setByAngle", Array(360)) ' Rotate by 360 degrees
' rotateTransition.RunMethod("setCycleCount", Array(-1)) ' Infinite loop
' rotateTransition.RunMethod("setAutoReverse", Array(False))
' Start the rotation
' rotateTransition.RunMethod("play", Null)
End Sub
SureNothing (I think it's just a gift for @Star-Dust )
With bit effort with B4X and without AI he made a 3D in multiplatformI am sure that with a bit of effort one could turn this into a 3D rotating sphere.
Post the code that generated
B4J code generated by ChatGPT (it only failed to handle arrow key press events).