sorry for opening a new topic about this … i just want some feedback 
i attach the final version … with javadoc and everything
sorry for opening a new topic about this … i just want some feedback 
i attach the final version … with javadoc and everything
May this be used in endolf’s / my GUI system ?
i’m currently not at home … but where can i find your work?
Good to see you’ve javadoc’d it 
I’ll be sure to check it out this weekend 
Will.
on second thought, why was there no 2d text rendering stuff in xith? no need? i guess not …
and bluesky as i did it for everyone to use you may of course use it in your gui system … maybe with a little ‘thanks to’ text 
No need is not exactly the reason.
No time would be a better explanation :).
But endolf, I and others are actually making GUI Systems to fix that.
And for the “thanks to…” text, there’s no problem.
great!
… so … you may use it 
[edit] guess i can add this to the toolkit if i may? [/edit]
Perfect,
Thanx a lot (it saves me a lot of efforts)
For the toolkit I think you may sign up on http://xith-tk.dev.java.net and then upload your file.
arg … can anyone give me a hint how to use cvs? 
i use eclipse and its internal cvs system
i checked out the toolkit as a new project (with my login data), added my code and tried to commit
then i get this error message:
The server reported an error while performing the “cvs add” command.
“xith-tk: User goliat_skipson doesn’t have <VersionControl - Add> access to project xith-tk”
guess i’m lacking some rights?
you have to go to https://xith-tk.dev.java.net/ there you’ll have to be logged in (it seems that you have already an account) and then you can request a developer role, I guess (haven’t done that myself yet, but I think observer won’t be enough) Then Will will probably approve you and then you can commit your code.
Is that correct? @Will
Arne
just one last question before i (hopefully) commit this:
should i use three floats or a color3f internally?
Hi,
I had a play with Text2D yesterday and was impressed.
To do a little speed test, I edited the org.xith3d.Xith3DCubeTest demo, and added this code:
// before main loop
DText2D text = new DText2D("blar");
tf_2.addChild(text);
//in main loop
text.setText(((int) (Math.random() * 100000)) + "");
I lost 1-2ms of performance in comparison with running the test without that code. Though I should note, the test wasn’t very precise due to the fact only a small difference was detected and the margin of error is at least 1ms. To conclude, the speed penalty seemed quite acceptable when updating text (the penalty when just displaying text would be even less).
I like the code, the caching is great. The penalty of using multiple Shape2D’s is less than having to recreate the texture every update I think - unless you have a whole page of text I guess. I’m guessing the texture generation is the slowest part of the code is it?
It’s probably better to use three floats internally I guess – OR reuse your Color3f’s. In fact, you could reuse most of your Vector3f objects instead of chucking them. Not that this probably matters much since objects that die young are cheap, and one normally wouldn’t be updating text every frame anyway. Still - anytime you can remove a ‘new’ keyword is good.
I have approved your developer status for the xith-tk project.
Please add this class in a package named: org.xith3d.ui.text2d. I hope to see more sub-packages of org.xith3d.ui in the future like text3d and maybe a widgit/layout toolkit ;D (note, you will need to add the “ui” and “text2d” directories to CVS, please do so).
Before committing anything to the xith-tk CVS, please have a read of this document: http://xith.org/XithToolkitGuidelines
Thank you, this code will be very handy.
Cheers,
Will.
So the UI system I’m doing should be in org.xith3d.ui packages ?
Okay no problem.
All the text-based component will use Text2D.
i’ll commit my work soon …
there’s just a last thing i thought of to improve textchanging speed … guess it would be just to change the texture on existing geometries than to replace the whole shape … this would mean some code restructoring but no change to the interface … i’ll look into this tomorrow morning
my commit will add:
org.xith3d.ui.text2d.Text2D,
org.xith3d.ui.text2d.Line and
org.xith3d.ui.text2d.Character
to the xith3d toolkit
Yes, I think that makes the most sense - make it a child of “ui”. I will move the com.xith3d.userinterface package into the xith-tk as well, as a child of ui (what should I call it? swingui perhaps? This is so others can potentially help fix it up.
Will.
org.xith3d.ui.swing
Good idea…
just a short note:
i’ll put some effort in a text3d implementation for the next days
Wasn’t there one ?
is there? haven’t seen it … in the toolkit?
There was, but it was JOGL only I believe.
If you come up with a generic 3D text implementation, that would be fantastic!
The other Text3D implementation is here: http://192.18.37.44/forums/index.php?topic=8463.0
It uses GLU code I believe. Theoretically this should work for LWJGL too, so you may be able to adapt that code. That said, it is better to keep low level OpenGL stuff out of the scenegraph API alltogether, so I think a Text3D implementation that didn’t need this would be good (IIRC, GLU is simply some precompiled algorithms distributed with C anyway, there’s nothing special about that code that I know of except that it has already been written and is distributed with OpenGL).
Thank you for your continued contribution to Xith3D!
Cheers,
Will.