multiple 3d text occurences

May 1, 2009 at 10:12pm

multiple 3d text occurences

Hi everybody.
For a new project, I need to display lots of sentences at deferent places in my 3d scene.
The problem is that I can’t create a new “text3d” object each time I have to display a sentence.
So my question is:
Is there a way to send new text and new coordinates to a single 3dtext object without deleting the previous displayed sentence?
thanks for your help.
piet

#43633
May 1, 2009 at 11:05pm

I had to do the same thing recently and I ended up making my own mxj that creates a load of objects each with their own jit.gl.text3d and managed iterating through them all and rendering them. here’s a link to the code (just ignore all the extraneous stuff about traer physics)

http://www.cycling74.com/forums/index.php?t=msg&goto=170211&rid=4892&S=0240b9ad4ba2be7735a02fef7e2743c0&srch=blobviz#msg_170211

#156566
May 2, 2009 at 9:00am

Thanks for this advice but, still a beginner, I opened your patch, put the java files and class in the dedicated cycling folder,
but nothing occurs when I try to open the source.
I got the same errors than Axiom
So I tried to follow your indications for compiling blob.java and bloviz from a new mxj quickie dummy…
And I also got errors like this:

/Applications/Max5/Cycling ’74/java/classes/BlobViz.java[ 4 ] package traer.physics does not exist
import traer.physics.*;
^
/Applications/Max5/Cycling ’74/java/classes/BlobViz.java[ 19 ] cannot find symbol
symbol : class ParticleSystem
location: class BlobViz
ParticleSystem physics;
^
/Applications/Max5/Cycling ’74/java/classes/BlobViz.java[ 20 ] cannot find symbol
symbol : class Particle
location: class BlobViz
Particle graviton;
^
/Applications/Max5/Cycling ’74/java/classes/BlobViz.java[ 54 ] cannot find symbol
symbol : class ParticleSystem
location: class BlobViz
physics = new ParticleSystem(0f, 0.00f);
^
/Applications/Max5/Cycling ’74/java/classes/Blob.java[ 4 ] package traer.physics does not exist
import traer.physics.*;
^
/Applications/Max5/Cycling ’74/java/classes/Blob.java[ 12 ] cannot find symbol
symbol : class Particle
location: class Blob
Particle p;
^
/Applications/Max5/Cycling ’74/java/classes/Blob.java[ 16 ] cannot find symbol
symbol : class ParticleSystem
location: class Blob
public Blob(ParticleSystem ps, Particle g, Random generator) {
^
/Applications/Max5/Cycling ’74/java/classes/Blob.java[ 16 ] cannot find symbol
symbol : class Particle
location: class Blob
public Blob(ParticleSystem ps, Particle g, Random generator) {
^
/Applications/Max5/Cycling ’74/java/classes/Blob.java[ 24 ] cannot find symbol
symbol : class ParticleSystem
location: class Blob
public void setup(ArrayList l, ParticleSystem ps) {
^
Note: /Applications/Max5/Cycling ’74/java/classes/BlobViz.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
[ 2 mai 2009 10:53:24 ]
compilation of /Applications/Max5/Cycling ’74/java/classes/BlobViz.java failed.

I think I need to learn a bit java before diving into such stuff.
I hoped there was “built in” solutions for multiple text occurences with only one text object…

#156567
May 2, 2009 at 11:56am

yeah i didn’t mean for you to compile the code exactly, you’d need an extra jar which is extraneous for what you want to do. if you want multiple occorunces of the same text then jit.gl.multiple is your answer, if you want multiple occurences of different text without different text3d objects for each then scripting is the only way i can think of.

have a look at the writing externals in mxj pdf which should be hidden in the cycling74 folder somewhere and all the examples for java and jitter that are in there too. there’s plenty of code to adapt.

hope you find something that works for you scripted or otherwise

#156568
May 2, 2009 at 5:07pm

thanks again.
I don’t have enough time to study java those days, but it’s actually something I will work on later.
I found this thread:

http://www.cycling74.com/forums/index.php?t=msg&rid=8763&S=b0c30e321c646d52a316acd30dbef548&th=30708&goto=127921#msg_127921/a>

where leafcuter created several 2d text occurences with one 2dtext object.
But I don’t really understand why each new word doen’t replace the previous one?
If someone could enlighten me about that?
piet

#156569
May 3, 2009 at 9:01am

this might not be the most efficient, but you can easily use multiple instances of jit.gl.text3d. example attached, sorry for not adding comments.

#156570

You must be logged in to reply to this topic.