• Content count

  • Joined

  • Last visited

Community Reputation

226 Neutral

About arithma

  • Rank
    Advanced Member
  1. I've been trying to internalise the 3D APIs for a while, but not having this thing as my main focus makes it really hard. Perhaps having things out, no matter how simple and silly they are, would help put some steam in my engine. So here we go: It's quite simple, and the ball is drawn using a simple shader that allows seeing the rolling of the ball. You'd need to close the app and open it again in order to reset the balls position.
  2. The child stream probably has a reference to the port.
  3. [Help] Vertex pos/normal/coord

    @larspensjo: Thanks, got it! [quote][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left][background=rgb(250, 251, 252)]A check: You are doing the linking (glLinkProgram) of the shader program after the call of glBindAttribLocation(), don't you?[/quote][/background][/left][/size][/font][/color] [left][background=rgb(250, 251, 252)][font="helvetica, arial, verdana, tahoma, sans-serif"][size="2"][color="#282828"]I thought you were warning me of a pitfall rather than reminding me to do the right thing.[/color][/size][/font][/background][/left]
  4. [Help] Vertex pos/normal/coord

    Got it solved! I just had to use glGetAttributeLocation to get the identifiers from the linked shader program.
  5. [Help] Vertex pos/normal/coord

    @szecs: sizeof(Vertex) returns 32, which is 8*sizeof(float). @larspensjo: I tried both tricks (which are really nifty) but to no avail. @mhagain: I am targeting opengl es 2 on iPhone, so OGL3 is unfortunately not an option.
  6. [color=#000000][font=Arial,]I'm having trouble sending both normals and a u,v pair to my shaders. If I remove the normal, things work as expected.[/font][/color] [color=#000000][font=Arial,] It appears the v_normal is receiving the values that are intended for v_coord. I still have no idea though.[/font][/color][color=#000000][font=Arial,] I've spent a lot of time trying to figure out, but I really am not able to pick a sane set of actions to debug/experiment anymore.[/font][/color][color=#000000][font=Arial,] This is my vertex:[/font][/color] [source lang="cpp"]struct Vertex{ Vertex(vec3 const & v) : pos(v) {} vec3 pos; vec3 normal; real u, v; }; [/source] [source lang="cpp"] const int VERTEX_POS_INDX = 0; const int VERTEX_NORMAL_INDX = 1; const int VERTEX_TEXCOORD_INDX = 2; const int VERTEX_POS_SIZE = 3; const int VERTEX_NORMAL_SIZE = 3; const int VERTEX_TEXCOORD_SIZE = 2; GLuint vbo, ibo; glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sphere->vertices.size()*sizeof(Vertex), &sphere->vertices[0], GL_STATIC_DRAW); glGenBuffers(1, &ibo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sphere->indices.size()*sizeof(unsigned short), &sphere->indices[0], GL_STATIC_DRAW); glEnableVertexAttribArray ( VERTEX_POS_INDX ); glEnableVertexAttribArray ( VERTEX_NORMAL_INDX ); glEnableVertexAttribArray ( VERTEX_TEXCOORD_INDX ); int offset = 0; glVertexAttribPointer ( VERTEX_POS_INDX, VERTEX_POS_SIZE, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offset ); offset += VERTEX_POS_SIZE * sizeof(real); glVertexAttribPointer ( VERTEX_NORMAL_INDX, VERTEX_NORMAL_SIZE, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offset ); offset += VERTEX_NORMAL_SIZE * sizeof(real); glVertexAttribPointer ( VERTEX_TEXCOORD_INDX, VERTEX_TEXCOORD_INDX, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)offset ); glBindAttribLocation ( programObject, VERTEX_POS_INDX, "a_position" ); glBindAttribLocation ( programObject, VERTEX_NORMAL_INDX, "a_normal" ); glBindAttribLocation ( programObject, VERTEX_TEXCOORD_INDX, "a_coord" ); [/source] [source lang="cpp"]precision highp float; uniform mat4 u_mv; uniform mat4 u_mvp; uniform vec3 u_light; uniform vec3 u_up; attribute vec3 a_position; attribute vec2 a_coord; attribute vec3 a_normal; varying vec2 v_coord; varying vec3 v_normal; void main() { v_coord = a_coord; v_normal = a_normal; gl_Position = u_mvp * vec4(a_position, 1); } [/source] [source lang="cpp"]precision highp float; uniform vec3 u_up; varying vec3 v_normal; varying vec2 v_coord; precision highp float; uniform vec3 u_up; varying vec3 v_normal; varying vec2 v_coord; void main() { vec2 coord = v_coord; vec3 normal = v_normal; coord.x = mod(v_coord.x * 5.0, 1.0); coord.y = mod(v_coord.y * 5.0, 1.0); gl_FragColor = vec4 ( mod(coord.x*1.0,1.0), mod(coord.y*1.0,1.0), mod(normal.z*5.0,1.0)*0.0, 1.0 ); } [/source]
  7. Quote:now I know it's the 'runtime memory leak' that I'm always scared of, not 'app crash memory leak', thx. Not being scared of an 'app crash memory leak' shouldn't get you too cozy about an app crash. There are only a few cases where an app crash may make sense, otherwise, a sanely built application that is well tested should not crash and burn.
  8. Can someone help me name my API?

    I'd call it Miranda. More developers would want to pick her up and learn the API. I would call it SSG: Slick Scene Graph I would call it TD or ThreeDee How about: ThirD Why not call it: DepthEngine Or how about: TriangleOrchestra Or why not: EuclidSolid A simple "Geom" would suffice if you are into minimalism. Engeom is another possible name. (Engine + geom) Naming an API has a long lasting impact on the first impression of other developers, so name it wisely.
  9. @Antheus: Aren't we overstepping the fact that GUI systems (like Windows' GUI itself) is based on an infinite loop updating all contained elements? On a descriptive level however things are done in a more object oriented manner. C# Forms for example totally hide away the message loop and let the programmer interface with a completely object oriented api. What I am trying to say is that you can not strictly categorize a system as Object Oriented or as Data Centric. Another thing that comes to mind is that while mostly a Scene Graph is created in an object oriented manner, collision detection over it is probably data centric (especially when for example it is handled by hardware). Additionally in a single engine, the physics integrator may be data centric, the graphics may be object oriented with a streaming pipeline to the GPU, and a mostly custom Object Oriented GUI built on top of another immediate (or more API bound) methodology. It seems to me that things can get a bit hybrid, and a pure methodology in a newbie's head may lead them to try and bend things too much to 'fit the paradigm' that it will fail. You may take this post as a request for clarification on how things are really done rather than an assertion. Those are the things that haunt me while am trying to architect a complete base for a game (rather than saying an engine).
  10. Unity Are subqueries bad?

    Not to hijack the thread, but instead to put an example where I have failed to convert a subquery to table join. I am trying to select with t1 the corresponding latest t2 child record. (This can be thought of a versioning system, or a topic and latest post in a forum) You can check the query here:
  11. @MarkS: When you have a collection of objects that are almost of the same type but need a little bit of specialized behavior, what technique do you use to specialize that behavior? In OOP land the usual approach would be creating an interface for whatever you are going to iterate over, then deriving from that and overriding where you need to create specialized behavior. I would personally think that without an OO aproach, GUI objects can start becoming a bit weird and unnecessarily convoluted. On the other hand, when things start to be counted in the thousands (particles for example) in physics simulations, I've found myself often wandering away from OO approach that usually deals with behavior specification without regard to the amounts of objects existing. For example, instead of making the CPU handle vtable traversals for a thousand object, a non OO approach would find itself naturally optimizing away the overhead [I got the example from the impression of a featured article here on GDNet]. In my personal and very limited opinion, OO within the games realm can often be just a syntactic sugar over a strictly procedural approach (as in you could have just replaced that object call with a function call with a this pointer attached to it). I don't think of that as bad however and I hope others with more relevant experience can correct me. Hope it helps.
  12. 2D game engine SIMILAR to flash?

    I mainly use flashdevelop to create little demo-like experiments. You may also want to checkout for examples. The downside of using flash is of course the lack of proper hardware acceleration (for things like shaders and so on). The upside is that you can publish to browsers.
  13. delaunay triangulation doubt

    The closest match for the intended word, my guess, would be 'clarification needed' in a more proper grammar form.
  14. Is my CV good enough

    I am in no way offended by the replies, in the contrary, I appreciate the time taken to respond. I still haven't sent the CV link yet, and I know it is out of the standard. My experience has been a weird one as well: I've started as a Mechanical Engineer in this Hariri Canadian University (in the Middle East/Lebanon/Mechref). I worked in a research department dealing with RFID solutions. That department got a liquidation sentence, and I was offered a position in Web Development. Starting out with server side web dev using PHP/MySQL/Apache and some client side dev as well (mainly Ajax on top of the usual techs). Then came into the picture a huge project for a client in the arab gulf (emirates), which was mainly an Actionscript project that had a lot of glitter (but was a big architectural challenge that I am proud to have gone through and accomplished..) A backdrop to my background, I've always loved math, been a member of this forum since before I went to university (since 2002 - I guess I reregistered because I had an embarrassing login name or so), and I've always had a lot to do with graphics, game, physics and math. While employed it felt like being trapped in a box (and further the employment conditions were extremely harsh, worse yet was the peer pressure (though lots of fun) but kind of made us all do overnight after overnight). So here I am, changing my situation, hoping to go for a masters degree in computer science or do some paid university level research in computer graphics. This CV is specifically for that, and the thing that got me going so far with a professor at a major regional university ( is the demo on the top of this list. I believe there must be some kind of introduction in the beginning, and some more detail and possibly an eye catcher for each of the projects later listed. I wish I had some more guidance with the choices I've done over the recent years, as to what I should be focusing on in my studies, the type of job I should be having and so on. This is what I have to work with, and I am trying to make the best of it.. This post turned out to be a gush your life story.. Sorry for anyone who was bothered enough to read through the whole thing and then discover they were annoyed :)
  15. I have this dover book, but I read somewhere online that it uses some old notation and that recently there has been rise for a different notation (I believe differential notation) that is more widely used in the other literature (physics specifically). I haven't been able to pin point another alternative book with this book's coverage. All help is appreciated.