I am pretty new to jme and game programming itself - but I have little bit of Java knowledge.
I wanted to draw a 2D circle. As far as I know jme does not have native libraries for this.
I thought about writing my own class, but that would probably be not performant at all.
I found two topics to this question, but one was using java awt (which I am sceptical if you should use the awt in jme - because they are two totally different Frameworks right?). (Link)
And for the other topic I did not get the code running. (Link)
In the second Link someone suggested using a Torus with a small outer radius. I took on that Idea, copied the Torus class and deleted everything which I thought to be not used for the 2D circle (unfortunately I don’t fully comprehend the Torus Code yet, so I am not sure how successful i was).
My question is: Is it bad to create a Circle like this? (except from the part that I do not really understand the whole Torus-Class Code)
Because I wonder why in both of the Forum-Topics nobody used the existing 3D classes to create a 2D circle.
Will the Code still be bloated and unperformant for 2D (e.g. because of inherited methods and variables)?
And a second question:
Is it correct that there are only the classes in “com.jme3.scene.shape” for things you can draw out of the box in jme?
Then I would need to modify an existing class again or write my own class to create for example a curved line, right?
(As far as I understand jme is primary for 3D usage and importing models rather than using 2D and draw in the application - but there is nothing wrong with using 2D and drawing in jme too - right?)
Thanks in advance for answers!
(I did not add the modified Torus class because of its length - but if it would help somehow I will do it)
I wanted to start with creating a simple stickman figure and the stickmen needs a head ^^.
I thought about using a circle image but I dont like that if everything else is a line.
I could create the whole stickmen as a picture, but if I want to add and animation (e.g. walking) I would need to create more Images (or I would need a 3D model if I understand it correct). But I wanted to concentrate to learn jme and game programming and not put much time into external graphic tools.
Edit: If it is important: right now I plan to use the guiNode at first and not the rootNode. As far as I understand ist the first for 2D and the second for 3D.
Mhh ok I will think about it. Thanks for the answers.
I can see it getting more complicated code-wise. My initial reason for this was not to create a full game but to start learning JMonkey. And I thought that this would be a good practice. But I will see, perhaps I do it with prebuild models.
Yeah, that’s the only reason I mentioned it. If this is just like stand-in geometry to get you started then do what’s simpler and don’t get hung up on this thing.
If you were trying to make some cutting edge stick figure game then that would be different… as it is, start simpler. JME even has some assets you might use (3D) or you can find tons of sprite sheets and stuff online also. This guy Kenny makes some pretty decent stuff I’ve used as stand-ins before: http://kenney.nl/