I started to realize this Open Frameworks tutorial with Pure Data and Ofelia: http://openframeworks.cc/ofBook/chapters/generativemesh.html
Everything works fine until i reached the chapter "Manipulations: Adding effects that modify the mesh". Theres no need for me to finish the tutorial, but perhaps someone wants to use the patch, or optimize it, or learn from it. Perhaps I will finish the tutorial by myself when I have the time and know how to do it.
hubble.zip
-
"Basics of Generating Meshes from an Image" - Ofelia
-
@cuinjune thanks for the explanations. here is an updated version. motion works nice now with ofEditMesh3d. "fill" seems great in the LineNoise example with ofGetPolyline2dCommand, but in my patch with ofGetMesh3dCommands (inside the orange canvas) it is somehow much slower than ofEditMesh3d. perhaps it is because i use ofGetMesh3dCommands because there is no ofGetMesh3dCommand?
hubble10.pd -
@Jona [ofGetMesh3dCommands] outputs all stored mesh commands as a list. It's mainly used for copying one mesh to another and printing out a large number of list to pd console can be really slow.
If you want to use "fill" to modify the vertices stored in a mesh, you should use [ofGetMesh3dVertex] to get the vertex at the specified index.
And then you can modify the vertex (e.g. add random values to it) and send "fill vertex x y z index" message to [ofLoadMesh3d] object. (it can also be like "fill vertex x y z first last" if you want to fill the range(first, last))Here's the patch which I added what I explained above. hubble11.pd
You will find this part in the patch.
[ofCountUntil] is like [until] and [ofCount] merged together so you can use it instead of using the 2 objects.
I hope this will help. -
@cuinjune thanks a lot, this is great this way "fill" makes the patch much more efficient, i have around 5% cpu load now. are there cases where it is better to use ofEditMesh3dVertex instead? hubble13.pd
-
@Jona Technically, you can do everything that [ofEditMesh3dVertex] can do using [ofGetMesh3dVertex] and "fill". But if you use [ofEditMesh3dVertex], you can directly apply various math operations to its internal data which can be more convenient(and sometimes more efficient) than having to use [ofGetMesh3dVertex], [ofExpr] and "fill".
[ofEditMesh3dVertex] has same functionality as [ofEditVec3f] because mesh3d's vertices are made of vec3f data type. These editor objects can be useful for handling properties of 2d/3d object such as position, velocity or acceleration.
You can read the OF documentation about this. http://openframeworks.cc/documentation/math/ofVec3f/
Also, you can check examples fromofelia/examples/vectors
directory. -
@cuinjune i tried to patch the last two parts of the tutorial orbit and magnifying, it works more or less but i think i choose wrong values for ofMap or ofNormalize, or i made something wrong with orientation. hubble_13a.zip
-
Hi man, I implemented the orbit part. Here's the patch. 1521650739907-hubble_13a2.zip
I fixed your patch a bit so it doesn't have to use [delay] anymore.
I also wrote some note about how things work at the top of the patch.I guess you may have done something wrong with [ofMap]. It doesn't automatically clamp a value between the range so you need to use [ofClamp] or [clip] to clip the mapped value. But I think I will add the 5th optional argument to [ofMap] which can enable/disable the clamp since the OF method also has it. http://openframeworks.cc/documentation/math/ofMath/#!show_ofMap
I think I will quickly add this update to the current version(v1.0.6) today or tomorrow.
Also, you may have been confused when implementing "ofGetElapsedTimef()" in OF which returns the elapsed time in seconds but [ofGetElapsedTime] object in ofelia actually returns the time in milliseconds. So I had to divide the value by 1000 in ofelia.
Since I find this can be confusing to some users (especially ones who used OF), I'm considering to make [ofGetElapsedTime] return the time in seconds and create another object called [ofGetElapsedTimeMillis] to return the time in milliseconds similar to the original OF methods http://openframeworks.cc/documentation/utils/ofUtils/#show_ofGetElapsedTimef
I wonder what you think about this idea.
And If you still have trouble implementing magnifying example in spite of knowing the possible issues I mentioned above, please let me know.
EDIT: I just updated and re-uploaded v1.0.6 onto Deken after applying the above mentioned things. Check out ofelia/CHANGES.txt file for changes.
And here's an updated patch for v1.0.6 hubble13a3.pd this one no longer divides [ofGetElapsedTime] by 1000 because [ofGetElapsedTime] now returns time in seconds.
-
@cuinjune hi. Thanks for your work (and the hints), especially for the update (with the very nice gui examples) and ofelia itself I really like it. I think it is a great idea to make objects with the same functionality as in open frameworks, I would be interested to know what others think about that. I am without a computer until sunday, so I will check the patch then. If you want to use it for the examples feel free to change / use what you want (like with any other patch). For me this patch is mainly for learning purposes.
-
@cuinjune i think also magnifying works well now, also together with orbit. its also a 3dmesh again. hubble13a7.pd
-
Hi everyone,
i'm just starting to coding in ofelia PD. In general the external library work very well...but now that I download your patches there are son much objects that Pd could not create.
Anyone could explain me how can I use these object?
here the screenshotthanks!
-
This thread is quite old, and AFAIK, @cuinjune has sort of rewrote the library and now there's only the [ofelia] external, and everything else is either written as a Lua script and loaded to [ofelia], or an abstraction, that includes [ofelia] with a Lua script loaded to it, pretty much the same thing, only the abstraction simplifies things a bit.
The best way to go would probably be to learn more about openFrameworks and Lua. This way you can really unleash the power of Ofelia!