Revision 513b2e9c
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/projection/ProjectionRenderer.java | ||
---|---|---|
29 | 29 |
import org.distorted.library.main.DistortedScreen; |
30 | 30 |
import org.distorted.library.mesh.MeshRectangles; |
31 | 31 |
import org.distorted.library.main.DistortedTexture; |
32 |
import org.distorted.library.type.Static1D; |
|
32 | 33 |
import org.distorted.library.type.Static3D; |
33 | 34 |
import org.distorted.library.type.Static4D; |
34 | 35 |
|
... | ... | |
65 | 66 |
Static4D region = new Static4D( 0, 0, 0, 0.25f); |
66 | 67 |
Static3D vector = new Static3D( 0, 0, 0.25f); |
67 | 68 |
|
69 |
Static1D deformRadius = new Static1D(1); |
|
70 |
|
|
68 | 71 |
mScale = new Static3D(1,1,1); |
69 | 72 |
|
70 | 73 |
mEffects.apply( new MatrixEffectScale(mScale) ); |
71 | 74 |
|
72 |
mEffects.apply( new VertexEffectDeform(vector, point1, region) ); |
|
73 |
mEffects.apply( new VertexEffectDeform(vector, point2, region) ); |
|
74 |
mEffects.apply( new VertexEffectDeform(vector, point3, region) ); |
|
75 |
mEffects.apply( new VertexEffectDeform(vector, point4, region) ); |
|
75 |
mEffects.apply( new VertexEffectDeform(vector, deformRadius, point1, region) );
|
|
76 |
mEffects.apply( new VertexEffectDeform(vector, deformRadius, point2, region) );
|
|
77 |
mEffects.apply( new VertexEffectDeform(vector, deformRadius, point3, region) );
|
|
78 |
mEffects.apply( new VertexEffectDeform(vector, deformRadius, point4, region) );
|
|
76 | 79 |
|
77 | 80 |
mTexture= new DistortedTexture(); |
78 | 81 |
} |
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.