Skip to main content

Adventure game problems - finishing touches

4 replies [Last post]
kedzol
Offline
Joined: 2007-01-02
Points: 0

Hi to All!

I'm working on an adventure game implementing in java with java3d and vrml models as my thesis at Budapest Polytehnic.
I'm close to finish the project, but stucked...and the time is running :(

I put the chat-string over the avatar, and the string must face to the users all the time, so i used Billboard, but:
it rewrites all the transformations, unable to scale, transform etc. the letters are half of the avatar, and it must move with the model

please help me
this is urgent

thx
Z

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
robertf
Offline
Joined: 2005-02-28
Points: 0

I have used Label3D for several years. This was originally written by Doug Gehringer when he was in the Java3D team at Sun.

Go to the old mailing list archives at http://archives.java.sun.com/cgi-bin/wa?A2=ind0107&L=java3d-interest&P=R...
the Label3D.java file is an attachment at the bottom.

As a general principle I highly recommend searching the old archive at http://archives.java.sun.com/archives/java3d-interest.html as well as the current java.net forum. It is full of hints, tips and workarounds.

drpaul
Offline
Joined: 2006-02-04
Points: 0

I don't understand this sentence:

"It rewrites all the transformations, unable to scale, transform etc."

It's not clear to me what you want/don't want it to do.

If you want the dimensions of the text box to be changable and are having trouble with that, you need to set the GeometryArray Capabilities to ALLOW_COORDINATE_READ/WRITE and your Appearance to ALLOW_APPEARANCE_READ/WRITE and also Appearance.ALLOW_TEXTURE_READ/WRITE. Then you can define a new coordinateArray and use it to set set a new geometryArray. Is this the sort of thing your trying to do?

If your chat string is only one line, you might try createing a simple Shape3D that is just a white rectangle and then use Text2D to clamp the text onto the rectangle. Billboard ought to be able to keep the rectangle's orientation toward the user.

If you need more flexibility, use the Text2D source code as a guide, and create your own texture from the text you want and texture the rectangle with it.

kedzol
Offline
Joined: 2007-01-02
Points: 0

Hi Dr. Paul!

Thx for your answer.

"It rewrites all the transformations, unable to scale, transform etc." meaning:

if i put string (without billboard) onto the canvas i can set transform, scale, rotation...
if i append a billboard to the string-object i can set the 'rotation-about-axis' or 'rotation-about-point' properties whitch set the position, the string will hold on that position, if i rotate the view the string will rotate around that location and face to the user

Translation:
to move the avatar (and i want the string move too):
avatarTransform3D.setTranslation(somewhere) and
stringTransform3D.setTranslation(somewhere)

it puts the avatar and the string (for an instant) that location, but the billboard rewrites the location of the string according to its properties, so it seems the avatar leave its speech behind...

Scale:
when i put a string out i use .setScale to set its size
and it does for an instant, and than billboard cancels it and i get my huge letters

thats my problem

i hope u have some tip for me

regards
Z

drpaul
Offline
Joined: 2006-02-04
Points: 0

I'm sorry that I can't give you the solution you're looking for because I never use Billboard.

However, if you can set the transform, scale and rotation of your string without using Billboard, what do you need Billboard for? Can't you simply calculate the correct rotation so that the string box is correctly oriented? That should just be a matter of keeping track of your ViewingPlatform angle.

Again, sorry I can't be more help with Billboard.