Parenting Problem

Blitz3D Forums/Blitz3D Programming/Parenting Problem

jfk EO-11110(Posted 2005) [#1]
Problem solved, it was exactly the same like this:
http://www.blitzbasic.com/Community/posts.php?topic=54570
EDIT 738:
In fact the problem was also caused by negative scaling of the mesh. When parented, the negative value used to flip the mesh insideout for some reason.
---------

original post:
I am parenting a mesh to an other mesh after loading both of them. This way the child mesh should not use the scaling, size etc. of the parent. At least that's what I have been thinking yet. But now it seems the child mesh does use the parents properties noneless, at least some properties:

EntityColor, EntityFX and Scaling and maybe more of the parent will affect the child. How can I turn this off?

Is this new or what's wrong?

EDIT: probably scaling is not used, but the position is not correct.


Stevie G(Posted 2005) [#2]
AFAIK it's always been the case. As soon as you parent an entity it's position relates to the scale of the parent. Pretty logical if you ask me.....

Pretty ott but parent , position , rotate , unparent , scale etc... maybe you're only option other than tformpoint using the parent as the source entity.

Stevie.


jfk EO-11110(Posted 2005) [#3]
Hi Stevie

I am pretty sure scaling, position and rotation was only taken from the parent when you loaded or created a mesh with the optional Parent argument. The alternative has always been to load it without parent argument and then use EntityParent to hierarchicly glue it to a parent without to use the parents properties. Of course, all following actions of the parent will then affect the child, but that's the way it used to be. In my code the EntityColor, rotation etc. of the parent is set before I parent the child to it.


jfk EO-11110(Posted 2005) [#4]
Ok, my mistake, it wasn't entitycolor or entityfx, but the mesh is flipped for some reason. (lights gave me the impression EntityFX and EntityColor where in action) I have to check the mesh again in the modeller, maybe there's something wrong with the normals. Tho, the normals invert only when I parent it to the other mesh, while the parent mesh has proper normals. First I thought it's the same problem like the one described here:
http://www.blitzbasic.com/Community/posts.php?topic=54570
and in fact the problem seems to be very similar.
well I got to check that mesh again...


jfk EO-11110(Posted 2005) [#5]
Ok, it actually WAS exactly the same as this:
http://www.blitzbasic.com/Community/posts.php?topic=54570

It was a flat "sandwich mesh" containing 2 quads, one facing to the left side and the other one to the right side. The normals where wrong, surfaces where pointing to the center.

Now I feel real stupid <:°] Sorry ppl.


DH(Posted 2005) [#6]
Well, dont feel stupid, cause the simple mistakes like this remind us that the system isn't broken, which is a good thing :-)


jfk EO-11110(Posted 2005) [#7]
that's right. well in fact it wasn't the same as the other problem as I thought yesterday night. Now it turned out I used to scale the depth with a negative value. THis caused the mesh to appear flipped when parented, but normal when not parented for some reason.