Alpha Problems when attached to joint...

Blitz3D Forums/Blitz3D Programming/Alpha Problems when attached to joint...

Black Hydra(Posted 2005) [#1]
Hi,

I have a model I am currently using for a boss enemy. It is separated into two meshes so that I can more effectively handle the textures.

But in order to do this, I must make a joint on the main model the parent of the second mesh (to preserve animations).

This works fine most of the time.

The only problem is when I destroy the enemy I fade it off the screen. The main mesh fades properly, but when I try to use:

EntityAlpha mesh, FadeAmt#

Nothing happens, it stays opaque. If I remove the code that parents the mesh to the joint then it fades properly.

Does anyone know what might be causing this. I have tried temporarily unparenting the second mesh, altering the alpha and then reattaching it but this has no effect. Any suggestions?


boomboommax(Posted 2005) [#2]
loop thru all children in a mesh and set the alpha of them, that will work.


Black Hydra(Posted 2005) [#3]
Hmmm... no, see, my problem is not that I am trying to set the alpha of only the main mesh. I am setting the alpha to both meshes individually.

Recursively looking through all the children wouldn't really do anything seeing as all of the "children", except for the two meshes themselves, are joints which cannot have their alpha modified (Blitz3D gives an error message and crashes if you try). Perhaps I am misinterpretting you?


Ross C(Posted 2005) [#4]
Isn't there a command to check whether an entity is a mesh or not?


Ricky Smith(Posted 2005) [#5]
Try looping through all children as suggested but doing a check on the entity class before trying to alpha - if the entity is a mesh then alpha it - if its a joint(pivot) then no.

http://www.blitzbasic.com/b3ddocs/command.php?name=EntityClass&ref=3d_a-z

You could also try another approach - instead of parenting the second mesh to a joint just position and rotate it to the GLOBAL x, y and z coordinates and pitch,yaw,roll values of the joint each loop.
The second mesh then remains an individual entity.


Shambler(Posted 2005) [#6]
http://www.blitzbasic.com/codearcs/codearcs.php?code=1170


Ross C(Posted 2005) [#7]
EntityClass, that's the one!


Ross C(Posted 2005) [#8]
In that case, what is a joint considered? A pivot?


Black Hydra(Posted 2005) [#9]
I tried using entityclass and recursively applying the alpha to all entities. This seems to work but it also seems a bit odd. Does this mean that alpha, while not affected by the parent entity, cannot be modified on a child entity unless it is also modified on the parent? Hmmm....

Thanks for your help.


Ross C(Posted 2005) [#10]
No, you can modify the child's alpha, but you can't set the parents alpha and have the childs alpha follow. Well, in most cases :o)