Camelia, the Perl 6 bug

IRC log for #openframeworks, 2013-08-27

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

All times shown according to UTC.

Time Nick Message
00:54 superFluid joined #openframeworks
02:20 jtnimoy joined #openframeworks
02:38 a1ex4nder joined #openframeworks
02:43 roxlu joined #openframeworks
03:05 jtnimoy joined #openframeworks
03:08 roxlu joined #openframeworks
04:08 jvcleave joined #openframeworks
04:29 a1ex4nder joined #openframeworks
06:28 jtnimoy joined #openframeworks
06:32 kevers joined #openframeworks
07:01 kikko_fr joined #openframeworks
07:14 goodman joined #openframeworks
07:41 jtnimoy joined #openframeworks
07:43 jtnimoy_ joined #openframeworks
08:22 kikko_fr joined #openframeworks
08:24 kikko_fr joined #openframeworks
09:09 burningdog joined #openframeworks
09:26 jtnimoy joined #openframeworks
10:25 underdoeg joined #openframeworks
10:41 kevers joined #openframeworks
11:25 workergnome joined #openframeworks
11:33 underdoeg joined #openframeworks
11:47 workergnome Anyone around to answer a question about rectangles?
12:04 tgfrerer workergno: sure!
12:05 helloworlds232 joined #openframeworks
12:07 kikko_fr joined #openframeworks
12:08 workergnome So.  In the ofRectangle class, there is setX and setY.
12:08 workergnome there is also setPosition
12:08 tgfrerer yep
12:09 workergnome what's the difference between x/y and position?
12:10 workergnome I feel like I'm missing something— setPosition sets the ofPoint position, which you can get with getPosition or getPositionRef, but everything else in the class uses x and y.
12:10 workergnome are they linked somewhere that I can't see?
12:10 tgfrerer I'm just checking this out in the source, now - seems a bit misleading, i agree.
12:11 workergnome the << operator returns position, width, and height.
12:12 workergnome and there's a reference to position.x and position.y in the initialization lists
12:12 workergnome but it's the input value, not the value being set.
12:12 tgfrerer yes, it should do. but these values should also be linked.
12:12 tgfrerer ahh, i see.
12:12 tgfrerer x and y are actually float references.
12:13 tgfrerer x and y are linked to position.x and position.y when the rectangle is intialised.
12:13 tgfrerer in the initialisation list
12:13 tgfrerer so these variables are synonymous.
12:13 tgfrerer if you use position.x it is as if you were using x
12:13 tgfrerer same for position.y
12:14 tgfrerer it's just a shortcut =)
12:14 tgfrerer so there is no difference.
12:14 workergnome gotcha.
12:14 tgfrerer =)
12:14 workergnome What's the name of the linking technique there?  My c++ is terribly rusty.
12:15 tgfrerer it's a reference. if you look closely at ofRectangle.h#L215
12:15 tgfrerer you see that x is declared as float& x;
12:15 workergnome aaaah.
12:16 tgfrerer meaning x is declared as a "float refrence x"
12:16 workergnome Got it.
12:16 workergnome Thank you so much.
12:16 tgfrerer you know the difference between pointers and references?
12:16 workergnome I do.
12:16 tgfrerer perfect!
12:37 kikko_fr joined #openframeworks
12:54 superFluid joined #openframeworks
13:22 jacres joined #openframeworks
14:21 jtnimoy joined #openframeworks
14:32 admsyn joined #openframeworks
14:54 a1ex4nder joined #openframeworks
15:44 goodman joined #openframeworks
16:11 jacres joined #openframeworks
16:17 DrCode joined #openframeworks
16:35 underdoeg left #openframeworks
16:40 jtnimoy joined #openframeworks
16:42 jtnimoy joined #openframeworks
16:45 workergnome joined #openframeworks
17:05 superFluid joined #openframeworks
17:13 pnitsch joined #openframeworks
17:23 pnitsch joined #openframeworks
17:44 kikko_fr joined #openframeworks
17:57 seb_ly joined #openframeworks
18:06 GuidovanPossum joined #openframeworks
18:15 GuidovanPossum joined #openframeworks
18:53 a1ex4nder joined #openframeworks
19:06 workergnome left #openframeworks
19:07 a1ex4nder joined #openframeworks
19:44 kevers joined #openframeworks
19:54 kikko_fr joined #openframeworks
20:20 DrCode joined #openframeworks
20:48 GuidovanPossum joined #openframeworks
20:56 RBB joined #openframeworks
20:59 GuidovanPossum joined #openframeworks
21:00 RBB Is it possible to directly modify the vertex data memory of an ofVboMesh and have those changes displayed? I've been trying, but no luck. Maybe its the wrong approach.
21:00 admsyn can you show your code?
21:01 admsyn chances are you just have to tell the vbo mesh to re-upload the new data to the GPU, though
21:01 jacres joined #openframeworks
21:02 RBB I have a grid of cubes all appended to one mesh and I get a pointer to what I believe is the start of their vert data
21:02 RBB vertPtr = mesh.getVerticesPointer()+ind*24;
21:02 RBB then for each of the 24 verts per cube
21:02 RBB ofVec3f * cur = vertPtr+a;
21:02 RBB memcpy(cur, new ofVec3f(cubeMesh.getVertex(a) * nscl + pos), sizeof(ofVec3f));
21:03 RBB so vertPtr should be the first vert of a particular cube
21:04 RBB I'm doing that to each of them, trying to scale them
21:04 admsyn yeah that's kind of a weird usage of memcpy (at least to me)
21:04 admsyn but the problem is probably that you're only updating the "local" copy of your vert data, and the ofVboMesh isn't realizing it needs to re-upload the new data to the GPU
21:05 RBB yeah I thought that might be it
21:05 RBB is there api to tell it to re-upload or would it just be raw ogl calls?
21:06 admsyn you should be using the update*Data functions, which will let the internal ofVbo know that you've changed something
21:07 RBB like this?
21:07 RBB mesh.getVbo().updateVertexD​ata(&mesh.getVertices()[0], num*24);
21:08 admsyn sure, but you'd just be updating it to itself at that point I believe
21:08 admsyn as in you'd be basically doing the equivalent of mesh[0] = mesh[0], mesh[1] = mesh[1] etc
21:09 admsyn you want to be doing something more like mesh.getVbo().updateVertexData(someNewData, num*24)
21:09 RBB if I modified the data on the CPU or whatever wouldn't this (&mesh.getVertices()[0]) point to it?
21:10 admsyn maybe, I don't know enough about the internals of ofVbo, but I wouldn't trust that to work
21:10 RBB yeah it doesn't seem to work, heh
21:10 admsyn try it by just generating some array of new data and updateVertexData()-ing that
21:10 admsyn just to see if it makes a difference
21:11 a1ex4nder joined #openframeworks
21:12 admsyn btw your memcpy code above would be leaking
21:12 jacres joined #openframeworks
21:14 RBB that worked admsyn
21:15 admsyn cool
21:19 jacres joined #openframeworks
21:25 vade joined #openframeworks
21:30 jtnimoy joined #openframeworks
22:02 jtnimoy joined #openframeworks
22:03 GuidovanPossum joined #openframeworks
22:31 superFluid joined #openframeworks
22:35 jtnimoy joined #openframeworks
23:01 jtnimoy joined #openframeworks

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