openFrameworks
openFrameworks copied to clipboard
Examples - Update
Some of the examples could be removed or refreshed / updated. Below are some that I think could use some attention and I plan to update. Will submit a PR per example.
3d
- [ ] 3d / cameraRibbonExample
- [x] 3d / meshFromCameraExample ( spins too fast ). #7091
- [x] 3d / ofNodeExample #7086
- [x] 3d / quaternionArcballExample #7090
- [x] 3d / quaternionLatLongExample #7089
communication
- [ ] communication / serialExample
gl
- [x] ~~gl / alphaMaskingShaderExample~~ ( remove, duplicate of shader / 07_fboAlphaMask) #7087
- [x] gl / areaLightExample #7078
- [x] gl / geometryShaderExample #7085
- [ ] gl / multiTextureShaderExample
- [x] gl / singleLightExample > change to gl/pointLightExample #7080
- [x] gl / transformFeedbackExample ( not included in OSX download? ) #7095
- [x] add animated transform feedback example to gl / transformFeedbackExampleAnimated #7094
- [ ] gl / computeShaderParticlesExample
shader
- [x] shader / 07_fboAlphaMask #7081
Thoughts on any other examples?
Great @NickHardeman! One example I really wanted to change is serialExample. It can be more inviting for beginners to work with serial communication, withtout memset, memcpy etc.
@dimitre oh yeah! I'll add it to the list. I haven't done serial communication in a while. Maybe someone can help out with that one ;)
I can work in an alternative approach, I use something like this
void ofApp::setup(){
int baud = 9600;
serial.listDevices();
vector <ofSerialDeviceInfo> deviceList = serial.getDeviceList();
// this should be set to whatever com port your serial device is connected to.
// (ie, COM4 on a pc, /dev/tty.... on linux, /dev/tty... on a mac)
// arduino users check in arduino app....
serial.setup(0, baud); //open the first device
}
void ofApp::update(){
if (serial.available()) {
serial.readBytes(buffer, serial.available());
serialData += buffer.getText();
serial.flush();
}
}
That definitely seems more approachable.
Going to ping @ofZach @LingDong @golanlevin on this thread and see if there are any examples that students often ask for.
I'll think about this, but off the top of my head, some demos my students always really appreciate:
- drawing into a high res fbo for high res image output
- examples that help explain how to do custom meshes / geometry and texture map them (ie, cut up a webcam into triangles, etc)
- converting paths -> polylines, polylines to meshes, etc
also if useful, @LingDong made this recently -- https://docs.google.com/spreadsheets/u/1/d/1cY0y377O5_fCWIJpXBNPofY-CCQq942r-sAb6SwKhkI/edit#gid=0 -- about conversions between different raster formats.... maybe some demo ideas there?
other things that may be cool --
- using offset shader (using a grain texture to add noise to drawing)
- texture feedback with shader (ie, ping ponging fbos and pushing colors via a shader)
Thanks @ofZach these are great! 👍
Been thinking that we should maybe just integrate the FBO read back from: https://github.com/satoruhiga/ofxFastFboReader into ofFbo.
The code is quite minimal and it would allow for realtime read back of high res FBOs.
converting paths -> polylines, polylines to meshes, etc
Oh this would be a great one!!
thanks!!
Edit: updated in this PR - https://github.com/openframeworks/openFrameworks/pull/7119 videoGrabber, maybe change resolution to 640x480 once macOS doesn't support 320x240 anymore in builtin webcam
Thank you for the insight @ofZach :) I added a few examples based on some of your suggestions
drawing into a high res fbo for high res image output
Simple saving of high res fbo #7104
converting paths -> polylines, polylines to meshes, etc
Paths to meshes from font #7109
I can work in an alternative approach, I use something like this
void ofApp::setup(){ int baud = 9600; serial.listDevices(); vector <ofSerialDeviceInfo> deviceList = serial.getDeviceList(); // this should be set to whatever com port your serial device is connected to. // (ie, COM4 on a pc, /dev/tty.... on linux, /dev/tty... on a mac) // arduino users check in arduino app.... serial.setup(0, baud); //open the first device } void ofApp::update(){ if (serial.available()) { serial.readBytes(buffer, serial.available()); serialData += buffer.getText(); serial.flush(); } }
@dimitre see #7101 :)
@ofZach - some thoughts on fbo readback here. Found an approach that seems faster than the ofxFastFboReader addon.
https://github.com/openframeworks/openFrameworks/issues/7111
Hi @NickHardeman
Thanks for those great examples!
Regarding the transformFeedbackExample
I think is safe to include it in macos download right? I saw you build the examples using that platform.
The removal of the example from the downloads in macos, is before we merged the fix for transform feedback in macos. #6473
So I think after the fix we could include it in macos download.
@eduardfrigola yes I created the example on macOS 12.5.1 with M1 chip. So it should be good to go on macOS
@eduardfrigola thank you! I had been doing transform feedback with all GL calls prior to making this example and discovered that it had been integrated into OF. It's really great. Makes it much more straight forward.
Hi! Already sent one PR but then realised that all the shader examples are currently missing a ;
on line 18, ofRunMainLoop()
in main.cpp
. Might be already on your list but just dropping in a comment :)