• What are you working on? v19
    6,590 replies, posted
Maurice it seems you didnt create the Not series... [url]http://www.oxeyegames.com/not-announcing-project-b/[/url]
[QUOTE=Richy19;32135314]Maurice it seems you didnt create the Not series... [url]http://www.oxeyegames.com/not-announcing-project-b/[/url][/QUOTE] They said something like that to Apple but they still sued the shit out of everyone
[QUOTE=Murkrow;32135536]They said something like that to Apple but they still sued the shit out of everyone[/QUOTE] [img]http://i.imgur.com/Jo8jH.png[/img]
[QUOTE=Maurice;32136116][img]http://i.imgur.com/Jo8jH.png[/img][/QUOTE] Even though I knew it was an image, I still had to try and drag it just to be sure.
Nobody posted in here for the past hour? Hijack thread! [img]http://i.imgur.com/gaf4v.gif[/img]
What are you doing up so late?
[QUOTE=DrLuke;32138391]What are you doing up so late?[/QUOTE] I'm eating pizza. Murk thinks it's weird to eat pizza at 2am but I really, really like pizza!
You might think this is a slightly unusual form of gouraud shading: [IMG]http://dl.dropbox.com/u/33076954/SlightlyUnusualGouraud.PNG[/IMG] you're probably right
[QUOTE=Maurice;32138452]I'm eating pizza. Murk thinks it's weird to eat pizza at 2am but I really, really like pizza![/QUOTE] It really is weird to eat that late.
[QUOTE=DrLuke;32138520]It really is weird to eat that late.[/QUOTE] Well I woke up at 6pm this is more like dinner for me.
[QUOTE=DrLuke;32138520]It really is weird to eat that late.[/QUOTE] There is always time for pizza
[QUOTE=Icedshot;32138568]There is always time for pizza[/QUOTE] Not when eating pasta.
[IMG]http://dl.dropbox.com/u/33076954/srslywtf.PNG[/IMG] more fun Edit: [IMG]http://dl.dropbox.com/u/33076954/erm.PNG[/IMG] I dont even
So I decided to write a matrices implementation for the hell of it. Mostly for practice because I've lost touch with C++ over the summer and need to be in shape when the semester starts. Anyway, here's what I have so far: [img]http://i.imgur.com/9V3w8.png[/img] Pretty much only did the constructors, the destructor and implemented multiplication. I probably need to find a decent algorithm for inverting matrices. The way I do it by hand is recursive and therefore (most likely) evil (inverse of T = (1/det(T))*(adj(T)transposed))
Grid based movement. :dance: [img]http://i51.tinypic.com/2d0gb54.gif[/img]
I should really create a showcase thread so I don't spam this thread with gifs of me doing stupid things. [img]http://i.imgur.com/0xu2X.gif[/img]
Stupid things are what make video games games.
Does anybody know anything about using mouse input in opengl to control a camera? I've made my own attempt at it, but I haven't been able to work it quite right. I made a post about it in WDYNHW if anybody knows about the subject: [url]http://www.facepunch.com/threads/1092921?p=32044874&viewfull=1#post32044874[/url]
[QUOTE=Icedshot;32138733][IMG]http://dl.dropbox.com/u/33076954/srslywtf.PNG[/IMG] < Edit: [IMG]http://dl.dropbox.com/u/33076954/erm.PNG[/IMG] I dont even[/QUOTE] Hey. I was thinking about how you said you sort triangles based on their average z value. Are you sure that will always give correct results? Let's say that you have a triangle with two points close to each other and the third one pointing far towards the screen and far up. It's average z would be close to the screen. Now if you have another normal triangle that's below the long one, further away from the screen than the last point of the longer one, but closer to the screen than the other two points. It's average z would be further away from the screen than the long ones, yet it should be rendered on top of the long one.
[QUOTE=Maurice;32138204]Nobody posted in here for the past hour? Hijack thread! [img]http://i.imgur.com/gaf4v.gif[/img][/QUOTE] hmm, wouldn't it be better to draw the world last ?, If you look there you see how mario is halfway through the block Edited: Word
[QUOTE=Capsup;32143483]Does anybody know anything about using mouse input in opengl to control a camera? I've made my own attempt at it, but I haven't been able to work it quite right. I made a post about it in WDYNHW if anybody knows about the subject: [url]http://www.facepunch.com/threads/1092921?p=32044874&viewfull=1#post32044874[/url][/QUOTE] One of the simplest ways is to center the cursor every frame, and use the X and Y coordinates as rotation along the X axis and rotation along the Y axis respectively. You would take the difference between where the cursor is supposed to be and where the cursor is, and the few pixels distance correspond to a certain amount of rotation. The camera itself can be implemented in many ways, one of the simplest being 3 vectors - an up vector, a right vector, and a look vector. The three vectors can then be passed to your math library's LookAt method, which will generate a proper matrix for you to send off to OpenGL/your shader. You could also use euler angles, but you'd run into gimbal locking issues. If you really want to use euler angles, consider using Quaternions to facilitate the rotation and to prevent gimbal locks from rotating your camera when you rotate along the X axis. Also the sample program turns my primary monitor to 640x480 and goes on for >15 seconds loading at the beginning, so I can't really test anything. It also hides/centers the mouse and doesn't let me exit the program without having to tab through task manager to select the process and end it.
[QUOTE=Orki;32143763]hmm, wouldn't it be better to draw the world last ?, If you look there you see how mario is halfway through the block Edited: Word[/QUOTE] Its just a clipping issue but yeah that would probably fix his small clippin issue n stuff. [editline]6th September 2011[/editline] Also, I don't understand opengl perspectives. Thats all I need to be able to get into opengl, as I understand just about everything else.
[QUOTE=Orki;32143763]hmm, wouldn't it be better to draw the world last ?[/QUOTE] Or use [url=http://love2d.org/wiki/love.graphics.setScissor]love.graphics.setScissor[/url]? I'm sure he would've considered this already, though; he's a pretty smart chap.
[QUOTE=Deco Da Man;32143962]Or use [url=http://love2d.org/wiki/love.graphics.setScissor]love.graphics.setScissor[/url]? I'm sure he would've considered this already, though; he's a pretty smart chap.[/QUOTE] I actually use scissor. The clipping issue only appears when mario is (potentially) inside 2 portals at once, and that is so minor that I don't care. Drawing the world on top doesn't work because mario's feet are actually 1 feet into the ground in SMB, and I'm a perfectionist when it comes to stupid stuff. [editline].[/editline] Map in a box, rating people funny when they say that I am (pretty) smart is not nice.
[QUOTE=The freeman;32134747]Reminds me of Roller Coaster Tycoon 1/2. Good work.[/QUOTE] The first of which was written almost entirely in an assembly language. This still doesn't cease to amaze me.
[QUOTE=Maurice;32144295]I actually use scissor. The clipping issue only appears when mario is (potentially) inside 2 portals at once, and that is so minor that I don't care. Drawing the world on top doesn't work because mario's feet are actually 1 feet into the ground in SMB, and I'm a perfectionist when it comes to stupid stuff. [editline].[/editline] Map in a box, rating people funny when they say that I am (pretty) smart is not nice.[/QUOTE] Sorry, my lord. I have corrected my poor judgement. Would you like some tea?
[QUOTE=robmaister12;32143882]One of the simplest ways is to center the cursor every frame, and use the X and Y coordinates as rotation along the X axis and rotation along the Y axis respectively. You would take the difference between where the cursor is supposed to be and where the cursor is, and the few pixels distance correspond to a certain amount of rotation. The camera itself can be implemented in many ways, one of the simplest being 3 vectors - an up vector, a right vector, and a look vector. The three vectors can then be passed to your math library's LookAt method, which will generate a proper matrix for you to send off to OpenGL/your shader. You could also use euler angles, but you'd run into gimbal locking issues. If you really want to use euler angles, consider using Quaternions to facilitate the rotation and to prevent gimbal locks from rotating your camera when you rotate along the X axis. Also the sample program turns my primary monitor to 640x480 and goes on for >15 seconds loading at the beginning, so I can't really test anything. It also hides/centers the mouse and doesn't let me exit the program without having to tab through task manager to select the process and end it.[/QUOTE] What you described first is exactly what I do. Every frame I get the difference between the current mouse pos and the middle of the window and then put that difference into my camera.addyaw function which updates the view matrix accordingly. However, my problem is that the movement of the mouse is very jaggy and that it for some reason jumps very huge distances all of a sudden if I keep moving the mouse in one of the directions. And the sample program was a bit of a gamble. I've only ever tried it on my own pc and my laptop, and they both work there. Are you sure it goes on >15 seconds loading at the beginning? The thing is that the 2 blue cubes in there aren't placed directly in front of you, but at the opposite side so you need to use the arrow keys to rotate the camera. And yes, I am aware that you cannot exit the program heh. I currently don't really care about any keys pressed other than the arrow keys. :P Perhaps I could add you on steam or something like that? I'd love to have someone else that I can test it out with. :)
[QUOTE=grlira;32138919]So I decided to write a matrices implementation for the hell of it. Mostly for practice because I've lost touch with C++ over the summer and need to be in shape when the semester starts. Anyway, here's what I have so far: [img]http://i.imgur.com/9V3w8.png[/img] Pretty much only did the constructors, the destructor and implemented multiplication. I probably need to find a decent algorithm for inverting matrices. The way I do it by hand is recursive and therefore (most likely) evil (inverse of T = (1/det(T))*adj(T transposed))[/QUOTE] I did this in Java once. To find the inverse, it augments the identity matrix to the right of the original one, rref's the resulting matrix, and the result contains the inverse of the original matrix in its right half. Here's how it works in code. [code] // attempts to construct and return the inverse of current matrix. public Matrix inverse() { if (M != N) throw new RuntimeException("Matrix is not square."); Matrix I = Matrix.identity(M); Matrix augrref = augment(I).rref(); double[][] data = new double[M][N]; for (int i = 0; i < M; ++i) { for (int j = 0; j < N; ++j) { data[i][j] = augrref.data[i][j+M]; } } Matrix inv = new Matrix(data); return inv; } // augments matrix B to the right of matrix A and returns resulting matrix C. public Matrix augment(Matrix B) { Matrix A = this; if (B.M != A.M) throw new RuntimeException("Illegal matrix dimensions."); double[][] data = new double[M][A.N+B.N]; for (int i = 0; i < M; ++i) { for (int j = 0; j < A.N; ++j) { data[i][j] = A.data[i][j]; } for (int k = 0; k < B.N; ++k) { data[i][A.N+k] = B.data[i][k]; } } Matrix C = new Matrix(data); return C; } // finds and returns the row reduced echelon form of current matrix. public Matrix rref() { Matrix A = new Matrix(this); int lead = 0; for (int i = 0; i < A.M; ++i) { if (A.N <= lead) { return A; } int k = i; while (A.data[i][lead] == 0) { ++k; if (k == A.M) { k = i; ++lead; if (lead == A.N) return A; } } if (k != i) A.swap(i,k); A.times(i, 1.0/A.data[i][lead]); for (int u = 0; u < A.M; ++u) { if (u != i) { double t = A.data[u][lead]; for (int j = 0; j < A.N; ++j) { A.data[u][j] = A.data[u][j] - t * A.data[i][j]; } } } ++lead; } return A; }[/code] In hindsight, I probably should've made this more readable. Oh, who am I kidding, I'll never do that anyway.
Incoming augment joke.
Pretty happy with the way my library works [csharp] var layer = new Layer(); var clip = new StencilShape(); //Define a triangular stencil shape clip.FilledPolygons.AddLast( new Polygon(false, new float[]{ 400, 100, 0, 0, 0, 0, 600, 400, 0, 0, 0, 0, 200, 400, 0, 0, 0, 0 })); clip.SetPolygons(); layer.StencilMasks.AddLast(clip); texture = new Texture(800, 500); var fbo = new FrameBuffer(); fbo.AttachTexture(texture); fbo.Bind(); //Make a new colored rectangle 100x100 var shape = new ColoredShape(); shape.FilledPolygons.AddLast( new Polygon(false, new float[]{ 0,0,1,0,0,1, 100,0,0,1,0,1, 100,100,0,0,1,1, 0,100,1,1,0,1 })); shape.SetPolygons(); //Move the rectangle 20 times and render each time (to the FBO) for (int i = 0; i < 20; ++i) { shape.X = Utility.GetRandomF() * 700; shape.Y = Utility.GetRandomF() * 400; shape.Render(); } fbo.Unbind(); //Make a shape to display the texture rendered to rect = new CenteredTexture(texture); rect.ScaleY = -1; rect.X = 400; rect.Y = 250; //Add the shape to the layer layer.List.AddLast(rect);[/csharp] Result: [img]http://i.imgur.com/dvFvV.png[/img]
Sorry, you need to Log In to post a reply to this thread.