Revision af662543
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/projection/ProjectionActivity.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
public class ProjectionActivity extends Activity implements OnSeekBarChangeListener |
35 | 35 |
{ |
36 |
private TextView textF, textX, textY;
|
|
36 |
private TextView textF, textN;
|
|
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
39 | 39 |
|
... | ... | |
44 | 44 |
setContentView(R.layout.projectionlayout); |
45 | 45 |
|
46 | 46 |
textF = (TextView)findViewById(R.id.projectionTextFOV); |
47 |
textX = (TextView)findViewById(R.id.projectionTextX); |
|
48 |
textY = (TextView)findViewById(R.id.projectionTextY); |
|
47 |
textN = (TextView)findViewById(R.id.projectionTextNear); |
|
49 | 48 |
|
50 | 49 |
SeekBar bar; |
51 | 50 |
|
52 | 51 |
bar = (SeekBar)findViewById(R.id.projectionSeekFOV); |
53 | 52 |
bar.setOnSeekBarChangeListener(this); |
54 | 53 |
bar.setProgress(50); |
55 |
bar = (SeekBar)findViewById(R.id.projectionSeekX); |
|
56 |
bar.setOnSeekBarChangeListener(this); |
|
57 |
bar.setProgress(50); |
|
58 |
bar = (SeekBar)findViewById(R.id.projectionSeekY); |
|
54 |
bar = (SeekBar)findViewById(R.id.projectionSeekNear); |
|
59 | 55 |
bar.setOnSeekBarChangeListener(this); |
60 | 56 |
bar.setProgress(50); |
61 | 57 |
} |
... | ... | |
95 | 91 |
|
96 | 92 |
public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) |
97 | 93 |
{ |
98 |
int ret;
|
|
94 |
float ret;
|
|
99 | 95 |
ProjectionSurfaceView view = (ProjectionSurfaceView)findViewById(R.id.surfaceViewProjection); |
100 | 96 |
ProjectionRenderer renderer = view.getRenderer(); |
101 | 97 |
|
102 | 98 |
switch (bar.getId()) |
103 | 99 |
{ |
104 |
case R.id.projectionSeekFOV: ret = renderer.setFOV(progress); |
|
105 |
textF.setText(getString(R.string.fov_placeholder,ret)); |
|
106 |
break; |
|
107 |
case R.id.projectionSeekX : ret = renderer.setX(progress); |
|
108 |
textX.setText(getString(R.string.x_placeholder,ret)); |
|
109 |
break; |
|
110 |
case R.id.projectionSeekY : ret = renderer.setY(progress); |
|
111 |
textY.setText(getString(R.string.y_placeholder,ret)); |
|
112 |
break; |
|
100 |
case R.id.projectionSeekFOV : ret = renderer.setFOV(progress); |
|
101 |
textF.setText(getString(R.string.fov_placeholder,(int)ret)); |
|
102 |
break; |
|
103 |
case R.id.projectionSeekNear: ret = renderer.setNear(progress); |
|
104 |
textN.setText(getString(R.string.near_placeholder,ret)); |
|
105 |
break; |
|
113 | 106 |
} |
114 | 107 |
} |
115 | 108 |
|
Also available in: Unified diff
Fixes for z-fighting.