Revision dfae5d27
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
---|---|---|
62 | 62 |
{ |
63 | 63 |
mView = v; |
64 | 64 |
|
65 |
Static3D pLeft = new Static3D( 98, 183, 0); |
|
66 |
Static3D pRight= new Static3D(233, 140, 0); |
|
67 |
|
|
68 |
Static4D rLeft = new Static4D( -3,-33,47,47); |
|
69 |
Static4D rRight= new Static4D(-14,-33,47,47); |
|
70 |
|
|
71 |
Dynamic3D dLeft = new Dynamic3D(2000,0.0f); |
|
72 |
Dynamic3D dRight= new Dynamic3D(2000,0.0f); |
|
65 |
Static3D pointLeft = new Static3D( 98, 183, 0); |
|
66 |
Static3D pointRight = new Static3D(233, 140, 0); |
|
67 |
Static4D regionLeft = new Static4D( -3,-33,47,47); |
|
68 |
Static4D regionRight= new Static4D(-14,-33,47,47); |
|
69 |
Dynamic3D dynLeft = new Dynamic3D(2000,0.0f); |
|
70 |
Dynamic3D dynRight = new Dynamic3D(2000,0.0f); |
|
73 | 71 |
|
74 | 72 |
Static3D p1 = new Static3D( 0, 0, 0); |
75 | 73 |
Static3D p2 = new Static3D(-15,-30, 0); |
74 |
|
|
75 |
dynLeft.add(p1); |
|
76 |
dynLeft.add(p1); |
|
77 |
dynLeft.add(p1); |
|
78 |
dynLeft.add(p1); |
|
79 |
dynLeft.add(p2); |
|
80 |
dynLeft.add(p2); |
|
76 | 81 |
|
77 |
dLeft.add(p1); |
|
78 |
dLeft.add(p1); |
|
79 |
dLeft.add(p1); |
|
80 |
dLeft.add(p1); |
|
81 |
dLeft.add(p2); |
|
82 |
dLeft.add(p2); |
|
83 |
|
|
84 |
dRight.add(p1); |
|
85 |
dRight.add(p2); |
|
86 |
dRight.add(p2); |
|
87 |
dRight.add(p1); |
|
88 |
dRight.add(p1); |
|
89 |
dRight.add(p1); |
|
82 |
dynRight.add(p1); |
|
83 |
dynRight.add(p2); |
|
84 |
dynRight.add(p2); |
|
85 |
dynRight.add(p1); |
|
86 |
dynRight.add(p1); |
|
87 |
dynRight.add(p1); |
|
90 | 88 |
|
91 | 89 |
mMove = new Static3D(0,0,0); |
92 | 90 |
mScale= new Static3D(1,1,1); |
93 | 91 |
|
94 | 92 |
mEffects = new DistortedEffects(); |
95 |
mEffects.apply( new VertexEffectDistort(dLeft , pLeft , rLeft) );
|
|
96 |
mEffects.apply( new VertexEffectDistort(dRight, pRight, rRight));
|
|
97 |
mEffects.apply(new MatrixEffectMove(mMove));
|
|
98 |
mEffects.apply(new MatrixEffectScale(mScale));
|
|
93 |
mEffects.apply( new VertexEffectDistort(dynLeft , pointLeft , regionLeft) );
|
|
94 |
mEffects.apply( new VertexEffectDistort(dynRight, pointRight, regionRight));
|
|
95 |
mEffects.apply( new MatrixEffectMove(mMove) );
|
|
96 |
mEffects.apply( new MatrixEffectScale(mScale) );
|
|
99 | 97 |
|
100 | 98 |
mScreen = new DistortedScreen(mView); |
101 | 99 |
} |
... | ... | |
118 | 116 |
mMove.set((width-w)/2,0,0); |
119 | 117 |
mScale.set(factor,factor,factor); |
120 | 118 |
} |
121 |
else
|
|
119 |
else |
|
122 | 120 |
{ |
123 | 121 |
int h = (width*mObjHeight)/mObjWidth; |
124 | 122 |
float factor = (float)width/mObjWidth; |
... | ... | |
126 | 124 |
mScale.set(factor,factor,factor); |
127 | 125 |
} |
128 | 126 |
|
129 |
mScreen.resize(width,height);
|
|
127 |
mScreen.resize(width,height); |
|
130 | 128 |
} |
131 | 129 |
|
132 | 130 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Bugfix (invert Region's y coord)