RenderTransformGoup - MIRROR X,Y,Z ?

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

humm,. not sure what you are suggesing here? have a look at the example file above,. what I am trying to do is mirror a construct of an iterator that renders a translated and rotated primitive,. the simplest way we have found to get the geometry all mirrored is to scale the whole group in the negative foe the mirror axis,. in the sample scale x = -1. If we can find a way to invert the WHOLE primative mesh then the negative scaling will cancel that out and we should have a mirrored geometry,. however no simple way to invert the whole primitive has be discovered. I think your method was assuming that the mirroring was done in the meshExpresion and not in the onRender, correct? interesting, but quite not working here..,
iterationGAMES.com
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

if you just need to invert the primitive, have you tried adding the Z or X or Y value for every sphere or box as soon it is created? By doing this you should get an inside-out mesh... then scaling it to neg values should make it right again. Like before but not inverting it again at the end. However i might give it a look tomorrow.
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej,

Francesco's suggestion is a good one, although you do end up moving the points around 2 extra times upon creation ( which doesn't really matter ). You'd want to use this approach if your MeshExpression is long and complicated. Probably doesn't get any easier ( right now ) then just having to add "this.V.X *= -1;" above and below your expression to mirror your mesh over the X axis.

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

negative scale mirroring - solved!

Post by jph_wacheski »

yup I was just tring that out,. I found that I needed to do both V and N invertion befro it worked nicely,.

this.V.X *= -1;
this.V.Y *= -1;
this.V.Z *= -1;

this.N.X *= -1;
this.N.Y *= -1;
this.N.Z *= -1;

Thanks Francesco! I'll attach the update example for anyone whanting to do this "negative scale mirroring",. . good for making arms, legs,. from primitives.
Attachments
negative_scale__mirror_example.zgeproj
works !
(2.24 KiB) Downloaded 487 times
iterationGAMES.com
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Fine :)
We will try to make it in a smarter way when we have spare time ;)
Post Reply