Browse Source

Map backspace to eraseSurface(). Erase last created.

master
Krisjanis Rijnieks 8 years ago
parent
commit
849904458a
  1. 123
      example-custom-shortcuts/bin/data/ofxpimapper.xml
  2. 2
      example-custom-shortcuts/src/ofApp.cpp

123
example-custom-shortcuts/bin/data/ofxpimapper.xml

@ -2,16 +2,16 @@
<surface type="0">
<vertices>
<vertex>
<x>400.000000000</x>
<y>50.000000000</y>
<x>347.000000000</x>
<y>-19.000000000</y>
</vertex>
<vertex>
<x>750.000000000</x>
<y>400.000000000</y>
<x>697.000000000</x>
<y>331.000000000</y>
</vertex>
<vertex>
<x>50.000000000</x>
<y>400.000000000</y>
<x>-3.000000000</x>
<y>331.000000000</y>
</vertex>
</vertices>
<texCoords>
@ -33,4 +33,115 @@
<source-name>image1.jpg</source-name>
</source>
</surface>
<surface type="1">
<vertices>
<vertex>
<x>283.000000000</x>
<y>34.000000000</y>
</vertex>
<vertex>
<x>983.000000000</x>
<y>34.000000000</y>
</vertex>
<vertex>
<x>983.000000000</x>
<y>384.000000000</y>
</vertex>
<vertex>
<x>283.000000000</x>
<y>384.000000000</y>
</vertex>
</vertices>
<texCoords>
<texCoord>
<x>0.000000000</x>
<y>0.000000000</y>
</texCoord>
<texCoord>
<x>1.000000000</x>
<y>0.000000000</y>
</texCoord>
<texCoord>
<x>1.000000000</x>
<y>1.000000000</y>
</texCoord>
<texCoord>
<x>0.000000000</x>
<y>1.000000000</y>
</texCoord>
</texCoords>
<source>
<source-type>none</source-type>
<source-name>none</source-name>
</source>
<properties>
<perspectiveWarping>1</perspectiveWarping>
</properties>
</surface>
<surface type="3">
<vertices>
<vertex>
<x>483.000000000</x>
<y>325.000000000</y>
</vertex>
<vertex>
<x>349.666656494</x>
<y>100.000000000</y>
</vertex>
<vertex>
<x>616.333312988</x>
<y>100.000000000</y>
</vertex>
<vertex>
<x>883.000000000</x>
<y>325.000000000</y>
</vertex>
<vertex>
<x>616.333312988</x>
<y>550.000000000</y>
</vertex>
<vertex>
<x>349.666656494</x>
<y>550.000000000</y>
</vertex>
<vertex>
<x>83.000000000</x>
<y>325.000000000</y>
</vertex>
</vertices>
<texCoords>
<texCoord>
<x>0.500000000</x>
<y>0.500000000</y>
</texCoord>
<texCoord>
<x>0.333333343</x>
<y>0.000000000</y>
</texCoord>
<texCoord>
<x>0.666666687</x>
<y>0.000000000</y>
</texCoord>
<texCoord>
<x>1.000000000</x>
<y>0.500000000</y>
</texCoord>
<texCoord>
<x>0.666666687</x>
<y>1.000000000</y>
</texCoord>
<texCoord>
<x>0.333333343</x>
<y>1.000000000</y>
</texCoord>
<texCoord>
<x>0.000000000</x>
<y>0.500000000</y>
</texCoord>
</texCoords>
<source>
<source-type>none</source-type>
<source-name>none</source-name>
</source>
</surface>
</surfaces>

2
example-custom-shortcuts/src/ofApp.cpp

@ -30,6 +30,8 @@ void ofApp::keyPressed(int key){
mapper.createSurface(ofx::piMapper::GRID_WARP_SURFACE);
}else if(key == 't'){
mapper.createSurface(ofx::piMapper::TRIANGLE_SURFACE);
}else if(key == OF_KEY_BACKSPACE){
mapper.eraseSurface(mapper.getNumSurfaces() - 1);
}else{
mapper.keyPressed(key);
}

Loading…
Cancel
Save