Main Menu

Still Another Suggestion...

Started by PrimordialSoup, March 08, 2003, 05:26:10 AM

Previous topic - Next topic

PrimordialSoup

I hope I'm not annoying you, but I have another idea, one I've actually been meaning to suggest since I looked closely at java.awt.color a couple of months ago.  I've just been forgeting to suggest...

Anyway, I was looking at java.awt.color and I noticed that all color objects have an alpha value associated with them that determines transparency.

I was wondering if setAdditionalColor() supports the alpha value.  If it doesn't use it, why not?  It seems a simple way to set both the color and the transparency of an object in one swoop...

I think it would be cool if it worked like that...

Thanx.
reating life isn't that hard.  Creating the UNIVERSE for it to live in is HARD!

EgonOlsen

I understand your point, but i'm undecided if i should support it that way. The thing is, that making setAdditionalColor() support the transparency as well somehow collides with the naming of this method (because the transparency isn't an additional color at all...it's a basic property of the Object3D and it should be treated like that IMO). Maybe i'll add another method that does this combined setting instead...any suggestions for the naming of this thing?
I've added the setScale()-method you requested and it will be included in the next release that should surface within some days (at least i hope so). Anyway, the scale()-method is buggy in 0.84...the normals will be screwed up if more than one scaling is applied to the same object. Ever noticed that as a problem?

PrimordialSoup

You could call the method setColor() using a java.awt.Color object as a parameter, under the assumption that the alpha value is a part of the color.

If that's not descriptive enough, perhaps setTransparentColor() would work...

And if you provide both setAdditionalColor() and setTransparentColor(), setTransparentColor() could just call setAdditionalColor() and then set the transparency for the object.

Also, what do you mean by normals?
Remember, you're talking to someone that is illiterate when it comes to 3D rendering terminology...
reating life isn't that hard.  Creating the UNIVERSE for it to live in is HARD!

EgonOlsen

I think i like the setTransparentColor()-idea the most. I think i'll add it. I don't know when the next release will be ready though. My new machine and my dev. environment are fine now, but i thougt it might be a good idea to put some Cyanacrylat glue (no...don't ask how this happened) into my left eye...this makes it quite difficult to see things clear...:cry:
Anyway, normals are used for lighting and backface culling and similar stuff. Every vertex of a Object3D is associated with a normal vector, which is rotated and translated together with the object. When scaling is used, the normals are scaled too...but they shouldn't because they have to be normalized (length==1)...hence the name. So they have to be adjusted afterwards. In 0.84 (and all former versions) this rescaling is buggy. The result is, that the object appears too bright or dark, depending on scaling. 0.85 will fix this.

Ambience

Not that it would really matter, but i can't find that setTransparentColor() method you mentioned. Did you forget to add it or am i blind?

EgonOlsen

Quote from: "Ambience"Not that it would really matter, but i can't find that setTransparentColor() method you mentioned. Did you forget to add it or am i blind?
Yes, i guess i've missed that one...not a big loss though. Maybe i'll add it to a later version.