Revision dae661e9
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/generic/GenericRenderer.java | ||
---|---|---|
129 | 129 |
MatrixEffectQuaternion quat2cen = new MatrixEffectQuaternion(mQuat2, mRotateCen); |
130 | 130 |
MatrixEffectMove centerMove = new MatrixEffectMove(mCenterPoint); |
131 | 131 |
|
132 |
centerEffects.apply(quat1cen); |
|
133 |
centerEffects.apply(quat2cen); |
|
134 |
centerEffects.apply( new MatrixEffectMove(mMoveCenter) ); |
|
135 |
centerEffects.apply( centerMove ); |
|
136 | 132 |
centerEffects.apply( new MatrixEffectScale(mScaleCenter) ); |
133 |
centerEffects.apply( centerMove ); |
|
134 |
centerEffects.apply( new MatrixEffectMove(mMoveCenter) ); |
|
135 |
centerEffects.apply(quat2cen); |
|
136 |
centerEffects.apply(quat1cen); |
|
137 | 137 |
|
138 |
regionEffects.apply(quat1cen); |
|
139 |
regionEffects.apply(quat2cen); |
|
140 |
regionEffects.apply( new MatrixEffectMove(mMoveRegion) ); |
|
141 |
regionEffects.apply( centerMove ); |
|
142 |
regionEffects.apply( new MatrixEffectMove(mRegionPoint) ); |
|
143 |
regionEffects.apply( new MatrixEffectScale(mRegionScalePoint) ); |
|
144 | 138 |
regionEffects.apply( new MatrixEffectMove(new Static3D( -regionSize*0.5f , -regionSize*0.5f , 0)) ); |
139 |
regionEffects.apply( new MatrixEffectScale(mRegionScalePoint) ); |
|
140 |
regionEffects.apply( new MatrixEffectMove(mRegionPoint) ); |
|
141 |
regionEffects.apply( centerMove ); |
|
142 |
regionEffects.apply( new MatrixEffectMove(mMoveRegion) ); |
|
143 |
regionEffects.apply(quat2cen); |
|
144 |
regionEffects.apply(quat1cen); |
|
145 | 145 |
|
146 | 146 |
resetMatrixEffects(); |
147 | 147 |
|
148 | 148 |
// quite tricky: move the background exactly to the FAR plane! (see InternalOutputSurface.setProjection() ) |
149 |
backgroundEffects.apply(new MatrixEffectMove(mMoveBackground) ); |
|
150 | 149 |
backgroundEffects.apply(new MatrixEffectScale(mScaleBackground) ); |
150 |
backgroundEffects.apply(new MatrixEffectMove(mMoveBackground) ); |
|
151 | 151 |
} |
152 | 152 |
|
153 | 153 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
161 | 161 |
MatrixEffectQuaternion quat1obj = new MatrixEffectQuaternion(mQuat1, rotateObj); |
162 | 162 |
MatrixEffectQuaternion quat2obj = new MatrixEffectQuaternion(mQuat2, rotateObj); |
163 | 163 |
|
164 |
objectEffects.apply( new MatrixEffectMove(mMoveObject)); |
|
165 |
objectEffects.apply( new MatrixEffectScale(mScaleObject) ); |
|
166 |
objectEffects.apply(quat1obj); |
|
167 | 164 |
objectEffects.apply(quat2obj); |
165 |
objectEffects.apply(quat1obj); |
|
166 |
objectEffects.apply( new MatrixEffectScale(mScaleObject) ); |
|
167 |
objectEffects.apply( new MatrixEffectMove(mMoveObject)); |
|
168 | 168 |
|
169 | 169 |
mQuat1.set(0,0,0,1); |
170 | 170 |
mQuat2.set(0,0,0,1); |
Also available in: Unified diff
Invert the order of Matrix Effects. Now, just as in the other queues, the first matrix effect is actually the first to act on the object - not the other way around!