Perl 6 - the future is here, just unevenly distributed

IRC log for #openframeworks, 2014-03-18

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:05 mikelikespie joined #openframeworks
00:45 tapout joined #openframeworks
00:49 dravidan joined #openframeworks
01:00 robot joined #openframeworks
01:12 workergnome joined #openframeworks
02:11 Hurtzy joined #openframeworks
03:09 admsyn joined #openframeworks
04:18 admsyn joined #openframeworks
04:30 pizthewiz joined #openframeworks
04:31 boltR joined #openframeworks
04:52 boltR joined #openframeworks
06:07 _mj joined #openframeworks
06:30 _mj joined #openframeworks
07:02 LCID_Fire joined #openframeworks
07:06 LCID_Fire_ joined #openframeworks
08:00 boltR joined #openframeworks
08:36 oneironaut joined #openframeworks
08:51 ofarturo joined #openframeworks
09:32 kflux joined #openframeworks
09:40 neue joined #openframeworks
09:46 _paul_ joined #openframeworks
09:46 _paul_ hello
09:47 _paul_ whats the difference between ofNosie and ofRandom ?
09:47 _paul_ *ofNoise
10:11 robot joined #openframeworks
11:06 jvcleave_ joined #openframeworks
11:47 robo joined #openframeworks
11:54 robot joined #openframeworks
12:07 jvcleave joined #openframeworks
12:09 OliverUv joined #openframeworks
12:47 robot joined #openframeworks
13:02 Joel_re joined #openframeworks
13:23 AceSlowman joined #openframeworks
14:15 admsyn joined #openframeworks
14:15 _paul_ helllloo
14:15 _paul_ anyone in here today ??
14:16 admsyn hi _paul_
14:25 lmccart_ joined #openframeworks
14:25 lmccart joined #openframeworks
14:38 admsyn joined #openframeworks
15:30 admsyn _paul_: ofNoise is perlin noise, ofRandom is completely random
15:31 admsyn it's easier to describe with a picture / example
15:32 admsyn but basically if you give it numbers in order (0.1, 0.2, 0.3) you'll get back numbers between 0 and 1 that "flow" together
15:32 admsyn yeah it's hard to explain in text :)
15:32 admsyn see the math/periodicSignalsExample
15:46 Joel_re hey, considering Im just starting off with openframeworks
15:46 Joel_re I have no background in linear algebra or building games
15:46 Joel_re do I just start with the examples
15:47 Joel_re or should I go back and study basics
15:47 admsyn no you can probably get off the ground just looking at the examples
15:48 admsyn linear algebra probably isn't the biggest deal, unless you're rolling your own physics engine or something like that
15:48 Joel_re ok, so if I want to add simple characters and have them move a bit, I should be able to pull it off by looking at examples
15:48 Joel_re and googling around
15:48 admsyn oh yeah for sure
15:49 Joel_re thanks
15:56 ofarturo joined #openframeworks
16:01 AceSlowman does anybody know of a way to fill an ofPath with video? or am I going to need to use my ofPath as a mask?
16:02 admsyn can you describe what you mean with "fill"? To me that basically sounds like using the ofPath to create a clipping mask
16:02 admsyn *alpha mask
16:02 admsyn Do you mean drawing a shape but instead of it being filled with e.g. red it's filled with video?
16:03 AceSlowman I think that would be right. I just have some contours from ofxCv, and I want to have a different video display in the space of each distinct shape
16:03 admsyn yeah alpha mask is the way to go
16:03 admsyn I remember bringing this up before, though, is it being troublesome?
16:04 AceSlowman Yeah a little bit (thanks for all of the help on this btw). I have my contours converted to polylines, and then I am currently trying to get those polylines into ofPaths, but I can't seem to keep an identifier attached throughout.
16:04 admsyn I guess that kinda begs the question: why ofPaths?
16:05 admsyn as in, is it just your goal to have video filling in the contours you get from ofxCv?
16:05 AceSlowman That is my goal, yes. I tried the ofPaths because I kept using the word "fill" when refering to this haha
16:06 admsyn you can probably get away with a std::map for attaching an identifier to a polyline
16:06 admsyn you could subclass the polyline and add an identifier member, too
16:06 robot joined #openframeworks
16:06 admsyn either would work, depends on how you want to work
16:07 AceSlowman Ok great, that should help simplify. So to utilize different videos, maybe I could place the video in the contour bounding box?
16:07 admsyn bounding box is handy for getting a rough idea of where the contour is, but you probably want a convex hull
16:10 AceSlowman Ok. So, I should create a new polyline for each contour, attach a corresponding identifier, and then create an alpha mask from that? Then constrain my video to the convex hull of the polyline (to make sure that a different video can display only inside the limits of the given contour)
16:14 dravidan joined #openframeworks
16:14 admsyn yeah that sounds like it'd work
16:14 admsyn you'll probably get issues if you have overlapping bounding boxes though
16:15 admsyn actually not really
16:15 admsyn yeah I think that'd work
16:16 AceSlowman If the two contours combined, they would probably change identifiers and just use one video right?
16:16 AceSlowman (which might be a cool effect)
16:16 admsyn yeah but you can have overlapping bounding boxes for contours that don't overlap
16:16 admsyn but if it's a cool effect then whatever :)
16:16 admsyn I think you're on the right track anyway, things like that you can work around once you get there I'm sure
16:18 AceSlowman Yeah exactly, if I can get that far my mind will be at ease. Thanks for all of the help. Being new to a community you always feel like you are riding the line between seeking help and badgering people.
16:19 admsyn don't worry about :)
16:19 admsyn *about it
16:31 ofarturo joined #openframeworks
16:37 pizthewiz joined #openframeworks
16:47 mikelikespie joined #openframeworks
16:52 nicedice joined #openframeworks
17:03 boltR joined #openframeworks
17:28 kflux joined #openframeworks
17:46 GuidovanPossum joined #openframeworks
18:24 mikelikespie joined #openframeworks
18:48 GuidovanPossum joined #openframeworks
19:06 mikelikespie joined #openframeworks
19:25 vade joined #openframeworks
19:54 AceSlowman joined #openframeworks
20:06 AceSlowman @admsyn , I was just curious about what you had said about using the polyline as an alpha mask. An alpha mask would be done through the use of a shader right? In which case, would I want to turn my contours into an ofMesh?
20:06 admsyn nope you don't need a mesh
20:07 admsyn if you render them as polygons into an fbo, you can use the fbo's texture as an alpha mask
20:07 AceSlowman Ok, so it is still just a matter of using the polyline as a shader alpha mask?
20:07 admsyn so, basically, if you can draw the ofPolylines as white filled-in polygons where you want the video to be, you're pretty much there
20:08 admsyn are you familiar with FBOs?
20:08 AceSlowman No I'm not. What are they?
20:08 admsyn you can use them to render to textures, and then use those textures to do other things (like draw them to the screen, or use them as alpha masks..)
20:09 admsyn check out the FBO example(s) and you should get the gist
20:09 admsyn but that's how you'd make the "mask" part of the alpha mask
20:10 admsyn so step one would be just drawing your ofPolylines as white polygons (e.g. in draw() )
20:10 admsyn then instead of drawing them to the screen, you make an FBO and draw them in there
20:11 admsyn (the fbo examples will show you how to do that, it's pretty straightforward)
20:14 AceSlowman joined #openframeworks
20:16 AceSlowman Sorry, connection problem, but yes, I'll start looking into those FBO examples. Thanks again for the huge help!
20:17 admsyn np
21:30 robot joined #openframeworks
21:37 kflux joined #openframeworks
21:42 admsyn joined #openframeworks
22:00 oneironaut AceSlowman: I use gl_stencil to mask video
22:01 oneironaut you only get hard lines (no gradient)
22:01 oneironaut gl_stencil lets you draw a shape that constrains the video
22:02 oneironaut as far as i know yo0u have to convert the mask to a polygon though (not sure if you can do curves in gl stencil)
22:02 oneironaut and to enable GL_STENCIL I had to muck with ofx code (btw).   there are some threads out there for it
22:03 oneironaut i ALWAYS have weird blending issues when i'm trying to render multiple fbos on top of eachother
22:04 oneironaut http://forum.openframeworks.cc/t/weird-problem‚Äč-rendering-semi-transparent-image-to-fbo/2215
22:08 oneironaut and, if anyone has a solution to the thread above, i'd be super thankful
22:11 AceSlowman I'm thinking to play it safe I will make it so I wont overlap fbos. (it will be performance based so I will just never allow the contours to overlap)
22:12 oneironaut i think the issues i encountered had mostly to do with semitransparency
22:12 oneironaut though i haven't tried to tackle the problem in a while
22:12 oneironaut i had a workaround that left some artifacts (but the clean polygon GL_STENCILS work perfectly very high performance)
22:14 AceSlowman I think my current problem is that my contours are being updated at framerate and as soon as I put them into the fbo it goes nuts.
22:17 admsyn how so?
22:20 AceSlowman So I managed to get the contours white, but as soon as I draw the mask fbo (in update()), it hardly runs (but does fill the contour with video as I intended)
22:20 admsyn can you identify what the slow bit is?
22:22 admsyn as in, if you start taking individual things out, which part is the one that makes it slow?
22:22 AceSlowman hmm.. one second I'll look for it
22:26 admsyn are you doing something like polygons -> FBO -> alpha mask shader -> screen?
22:27 AceSlowman ergh, now it isn't doing what it was doing before. But yes, I think that is the flow.
22:28 admsyn if you post your shader / update() and draw() code to pastebin we could maybe figure it out
22:29 AceSlowman That would be incredible, I'll work on getting that up.
22:32 GuidovanPossum joined #openframeworks
22:35 AceSlowman http://pastebin.com/2vJyj6Aw
22:35 AceSlowman I apologize for how messed up this must look, I need to step away from this later, come back, and clean it up
22:36 admsyn looks fine to me
22:36 admsyn btw, since you're already indenting your fbo.begin / fbo.end etc, a lot of people stick { }'s in there to help readability
22:39 admsyn oh for some reason I interpreted your "it goes nuts" as "it's really slow"
22:39 admsyn is that not what you meant?
22:40 AceSlowman ah! for some reason I accidentally defined ofPath pathFromContour; twice, so now it's showing up again. But yes, still very slow. Also the fbo isn't updating for when the contour moves. It kind of sweeps across...
22:41 admsyn :/
22:43 admsyn oh pathFromContour has all your shapes in it?
22:44 AceSlowman yeah... I resorted to the path again because it was the only thing I could manage to fill with white
22:44 admsyn no that's fine
22:44 admsyn it's set up a bit odd though
22:44 admsyn I g2g but there's a few things you could change:
22:45 admsyn 1. resample the polylines draw the paths into your mask in update()
22:46 admsyn 2. maybe resample your polylines, the contour finder tends to give pretty dense shapes
22:46 admsyn (so like polyline.resample(5) or so
22:46 admsyn )
22:47 admsyn 3. you might not need the intermediary FBO (the one called fbo), just do the shader-masking bit in draw, right to the screen
22:47 admsyn err that came out confusing because I'm in a hurry :)
22:47 admsyn good luck
22:47 GuidovanPossum I saw someone doing an example of something similar recently using opencv
22:47 AceSlowman No problem! THANK YOU!
22:49 AceSlowman I tried using blobs in opencv but I had some problems utilizing the vertexes. Mainly just me being new to it all, but ofxCv has been a lot easier for me
22:50 GuidovanPossum yeah, I bet I'm still learning too, I'm sure you know better than me
22:51 AceSlowman whew, it's been quite the learning experience so far. Thank god for this IRC channel and the OF forums.
23:09 robot joined #openframeworks
23:22 dantheman joined #openframeworks
23:26 AceSlowman joined #openframeworks

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary