RenderTransformGoup - MIRROR X,Y,Z ?
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
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
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.
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
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
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
negative scale mirroring - solved!
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.
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 491 times
iterationGAMES.com