Revision c1f047b9
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/predeform/PredeformRenderer.java | ||
---|---|---|
31 | 31 |
import org.distorted.library.main.DistortedTexture; |
32 | 32 |
import org.distorted.library.mesh.MeshBase; |
33 | 33 |
import org.distorted.library.type.DynamicQuat; |
34 |
import org.distorted.library.type.Static1D; |
|
35 | 34 |
import org.distorted.library.type.Static3D; |
36 | 35 |
import org.distorted.library.type.Static4D; |
37 | 36 |
|
... | ... | |
52 | 51 |
private DistortedScreen mScreen; |
53 | 52 |
private float mObjWidth, mObjHeight, mObjDepth; |
54 | 53 |
private Static3D mScale; |
55 |
private Static1D mAlpha; |
|
56 | 54 |
|
57 | 55 |
Static4D mQuat1, mQuat2; |
58 | 56 |
int mScreenMin; |
... | ... | |
63 | 61 |
{ |
64 | 62 |
mView = v; |
65 | 63 |
|
66 |
mAlpha = new Static1D(1.0f); |
|
67 | 64 |
mScale= new Static3D(1,1,1); |
68 | 65 |
|
69 | 66 |
Static3D center=new Static3D(0,0,0); |
... | ... | |
91 | 88 |
mEffects.apply( new MatrixEffectScale(mScale)); |
92 | 89 |
mEffects.apply( new MatrixEffectQuaternion(quatInt2, center) ); |
93 | 90 |
mEffects.apply( new MatrixEffectQuaternion(quatInt1, center) ); |
94 |
mEffects.apply( new FragmentEffectAlpha(mAlpha)); |
|
95 | 91 |
|
96 | 92 |
mScreen = new DistortedScreen(); |
97 | 93 |
mScreen.glClearColor(1.0f,1.0f,1.0f,0.0f); |
... | ... | |
117 | 113 |
mScreen.resize(width, height); |
118 | 114 |
} |
119 | 115 |
|
120 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
121 |
|
|
122 |
void setRenderModeToOIT(boolean oit) |
|
123 |
{ |
|
124 |
mScreen.setOrderIndependentTransparency(oit); |
|
125 |
} |
|
126 |
|
|
127 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
128 |
|
|
129 |
void setTransparency(int level) |
|
130 |
{ |
|
131 |
mAlpha.set((float)level/100.0f); |
|
132 |
} |
|
133 |
|
|
134 | 116 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
135 | 117 |
|
136 | 118 |
float setLevel(int level) |
Also available in: Unified diff
Progress with the Predeform app.