Revision 513b2e9c
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/sink/SinkRenderer.java | ||
---|---|---|
37 | 37 |
import org.distorted.library.type.Dynamic1D; |
38 | 38 |
import org.distorted.library.type.Static1D; |
39 | 39 |
import org.distorted.library.type.Static3D; |
40 |
import org.distorted.library.type.Static4D; |
|
40 | 41 |
|
41 | 42 |
import android.graphics.Bitmap; |
42 | 43 |
import android.graphics.BitmapFactory; |
... | ... | |
64 | 65 |
mScreen = new DistortedScreen(); |
65 | 66 |
|
66 | 67 |
Dynamic1D sinkStrength = new Dynamic1D(2000,0.0f); |
67 |
sinkStrength.add(new Static1D(1.0f));
|
|
68 |
sinkStrength.add(new Static1D(2.0f));
|
|
68 | 69 |
sinkStrength.add(new Static1D(0.2f)); |
69 | 70 |
|
70 | 71 |
// strength [changing in time from 1.0 to 0.2 and back], |
71 | 72 |
// center [(0,0,0), i.e. center of the bitmap], |
72 |
// region [null - apply to the whole bitmap
|
|
73 |
VertexEffectSink sinkEffect = new VertexEffectSink(sinkStrength, new Static3D(0,0,0), null);
|
|
73 |
// region [ (0,0,0) with radius 0.5 - apply to the center circle of the bitmap ]
|
|
74 |
VertexEffectSink sinkEffect = new VertexEffectSink(sinkStrength, new Static3D(0,0,0), new Static4D(0,0,0,0.5f) );
|
|
74 | 75 |
mEffects.apply(sinkEffect); |
75 | 76 |
|
76 | 77 |
mScale = new Static3D(1,1,1); |
Also available in: Unified diff
A lot of changes.
1) main vertex shader: remove support for degree_object. This functionality will hopefully come back when we introduce other than circular regions.
2) MeshBase: remove the need to set a Bounding box (this is the point of the whole thing - we wanted to get rid of this so that the advances in MeshJoined will be easier)
3) Set ground for removing the MeshBase.setStretch / getStretch (another thing needed to advance MeshJoined )
4) since we removed the Bounding box, we need to change the DEFORN effect to have 1 additional parameter, the 'radius' which takes over the function of the bounding box in the vertex shader.
5) since the'res no bounding box, simplify the postprocessing Halo (remove EffectQueueMatrix.magnify() )
6) adjust applications.
After this we will hopefully be ready to introduce MeshBase.preApply(VertexEffect), i.e. bending several simple Meshes with any VertexEffect - including the freshly-introduced PseudoMatrix-Vertex effects like VertexEffectScale - and then combining them into one MeshJoined.