• What are you working on? December 2011 Edition
    3,353 replies, posted
Functions are returning values properly! :D Took a little long than I'd anticipated - adding return statements made statement and block parsing a little more complicated as it's now possible, for example, to enter an if without hitting the matching end token, which lead to all sorts of wonderful headaches. Anyway, plotting the fibonacci function: [img]http://i.imgur.com/y6OCI.png[/img] Some function transformations: [img]http://i.imgur.com/tslcz.png[/img] What do you guys think so far? Anything you would change (other than VB6)? Interface? Syntax?
[QUOTE=Darwin226;33643009]Does it perform better than a simple grid if the objects that can collide are smaller than a grid cell? Because as far sad I can see, the benefit is that it first tests a group of objects against another group and if there's no collision it doesn't cross test the children, but in a grid based system, the amount of objects culled if far greater.[/QUOTE] Grid based systems don't work unless you know exactly what scale you're going to be working at. You can't use a grid for occlusion queries on something like a city, where you've got buildings, with rooms in the buildings, with desks in the rooms, with staplers on those desks. Each object has an entirely different scale, which a uniform grid won't accommodate. Additionally, hierarchical structures have O(log n) complexity, where even the best flat grid-based systems are going to be O(n), so BVHs and other hierarchical structures (like quad/octrees or k-D trees) scale better for larger data sets. It might not be entirely intuitive if you haven't worked with them before, but any well-formed hierarchical structure generally culls more objects with fewer tests at the highest branches than a flat grid. With a flat grid you also end up with lots of empty cells, which waste space and require unnecessary tests to process. Note that my circle BVH isn't the best example, it's just built as a quick-and-dirty test of a few ideas I had. While bounding spheres/circles are fast and simple, they generally don't 'fit' the objects they bound well. You can use AABBs or other geometry if you really need tight-fitting bounds. Additionally, since I'm doing online construction the tree that results is sub-optimal. Offline BVHs look much better.
[QUOTE=ROBO_DONUT;33643276]Grid based systems don't work unless you know exactly what scale you're going to be working at. You can't use a grid for occlusion queries on something like a city, where you've got buildings, with rooms in the buildings, with desks in the rooms, with staplers on those desks. Each object has an entirely different scale, which a uniform grid won't accommodate. Additionally, hierarchical structures have O(log n) complexity, where even the best flat grid-based systems are going to be O(n), so BVHs and other hierarchical structures (like quad/octrees or k-D trees) scale better for larger data sets. It might not be entirely intuitive if you haven't worked with them before, but any well-formed hierarchical structure generally culls more objects at the highest branches than a flat grid. Note that my circle BVH isn't the best example, it's just built as a quick-and-dirty test of a few ideas I had. While bounding spheres/circles are fast and simple, they generally don't 'fit' the objects they bound well. You can use AABBs or other geometry if you really need tight-fitting bounds. Additionally, since I'm doing online construction the tree that results is sub-optimal. Offline BVHs look much better.[/QUOTE] Yes but as I said, the objects are always smaller than a cell. If you had to solve collisions with that always being true would you still use a tree? [editline]9th December 2011[/editline] [QUOTE=r0b0tsquid;33643038]Functions are returning values properly! :D Took a little long than I'd anticipated - adding return statements made statement and block parsing a little more complicated as it's now possible, for example, to enter an if without hitting the matching end token, which lead to all sorts of wonderful headaches. Anyway, plotting the fibonacci function: [img]http://i.imgur.com/y6OCI.png[/img] Some function transformations: [img]http://i.imgur.com/tslcz.png[/img] What do you guys think so far? Anything you would change (other than VB6)? Interface? Syntax?[/QUOTE] It's slowly turning into a language of it's own. Maybe take it further and just turn the graphing part into the languages output.
Added comma-separated assignment lists, like Lua - so if, for instance, you wanted to swap two values, you'd just say [code]let x, y = y, x[/code] (expressions on the right are evaluated before the actual assignment.) Also, showing off some recursion: [img]http://i.imgur.com/l1bGu.png[/img] [editline]9th December 2011[/editline] [QUOTE=Darwin226;33643699] It's slowly turning into a language of it's own. Maybe take it further and just turn the graphing part into the languages output.[/QUOTE] That was kind of the plan (the language bit): the idea was to create a grapher with a simple scripting language, so that you could plot things other than straight relations. I started making it because I thought it would be something I might actually use :) it was a toss up between this and a game with programmable robots and stuff, so I asked you guys for a vote and the response was "grapher" :v: [editline]9th December 2011[/editline] For the record, the intention was definitely not to write it in VB6.
[vid]http://dl.dropbox.com/u/4093439/listboxscroll.webm[/vid] Horizontal scrollbars for listboxes. I'm loving how I'm eager to program again. I love working on UI shit for some reason :v:
Huh, I kinda like that external scrollbar dealio. Never seen that before, I don't think.
[QUOTE=voodooattack;33632856]Anyone seen this yet? [media]http://www.youtube.com/watch?v=UUnC5y4j0As[/media] Fuck Flash.. and fuck you Adobe, now we can embed C++ on the web. [editline]9th December 2011[/editline] I hope this spreads to other browsers.[/QUOTE] Sounds like a modern iteration of ActiveX controls for IE
[QUOTE=Dotmister;33644164]Sounds like a modern iteration of ActiveX controls for IE[/QUOTE] I wouldn't say that's a fair comparison.. ActiveX basically offers your system as a blood sacrifice to whatever it embeds. Not to mention that this doesn't involve Microsoft or COM interfaces.
Wow, sounds so dramatically different.
Made the conditional operators return the first value instead of 1 if the result is true - lets you do stuff like this: [img]http://i.imgur.com/FSInV.png[/img] Theta > 0 is shown in red; theta < 0 is shown in green. Also, atm keywords are case insensitive, while variable and procedure names are case sensitive - is this a good idea? I mean, the variable names should definitely be case insensitive, because upper and lower-case variables represent different things in maths, but I'd say "let" vs "Let" etc. is more a matter of personal preference?
Native Client is like CSS3, HTML5, WebGL, WebAudio, and tons of other cool technologies. You can only use it if everyone supports it. For now, it's Chrome only.
[QUOTE=amcfaggot;33644512]Wow, sounds so dramatically different.[/QUOTE] It is. [IMG]http://i.imgur.com/BHzcv.gif[/IMG] [editline]9th December 2011[/editline] [QUOTE=supersnail11;33644716]Native Client is like CSS3, HTML5, WebGL, WebAudio, and tons of other cool technologies. You can only use it if everyone supports it. For now, it's Chrome only.[/QUOTE] Yeah, unfortunately. Think of its other uses though, It'd be awesome for embedding native plugins in desktop applications securely.
[QUOTE=Darwin226;33643699]Yes but as I said, the objects are always smaller than a cell. If you had to solve collisions with that always being true would you still use a tree?[/QUOTE] I would, except maybe in some very specific cases. Grids won't work for large worlds because you need lots of (mostly empty) cells. Grids won't work as well in 3D as they do in 2D because of how they scale (grids actually can work [i]very well[/i] in 2D, but they're really no good for 3D). Your objects have to closely match the size of your cells because if any one cell contains too many objects then your grid isn't helping you at all (if you have 16 items in a cell, it would take 256 checks to resolve the collisions between them, if you have more it quickly grows worse). There are cases where grids can work, but it's not the one-size-fits-all solution some people believe it to be. You have to be very careful that the assumptions you make when choosing a grid are actually satisfied, whereas hierarchical structures will tend to adapt to whatever input you throw at them. Of course, this can easily become a 'premature optimization' issue. If you're doing a little 2D game with a few enemies and interactive objects, a simple grid is going to sufficient. A hierarchical structure in this case would be complete overkill and your development efforts are probably best spent elsewhere. My current project is 3D, so there should be a very real benefit to having a BVH for culling. Even though the simulation is 2D, I'd only have to change like two lines of code to make it 3D and the properties wouldn't change all that much. Programming is always a trade-off. There's never one method that's ideal for every situation.
[QUOTE=r0b0tsquid;33644587]Made the conditional operators return the first value instead of 1 if the result is true - lets you do stuff like this: [img]http://i.imgur.com/FSInV.png[/img][/QUOTE] Can it draw batman?
Made this in GLSL sandbox [url=http://glsl.heroku.com/643/0]Linky to my shader[/url] damn base64 images don't work
[QUOTE=uitham;33645713]Made this in GLSL sandbox [url=http://glsl.heroku.com/643/0]Linky to my shader[/url] damn base64 images don't work[/QUOTE] Whoa, this site is cool
[QUOTE=Murkrow;33645443]Can it draw batman?[/QUOTE] Express Batman as a mathematical relation, and I'll do my darndest to make it draw him.
[QUOTE=r0b0tsquid;33646330]Express Batman as a mathematical relation, and I'll do my darndest to make it draw him.[/QUOTE] The true test of any grapher warrior knight. [IMG]http://i.imgur.com/qcCP6.gif[/IMG] Godspeed.
Fuck no
noob
[QUOTE=r0b0tsquid;33646568]Fuck no[/QUOTE] Well you're no fun :|
At least, not yet. For now it only supports explicit relations - i.e., in the form variable = expression. It just iterates through the domain's values, and plots the value against the expression on the screen, drawing a line from one point to the next. I did have a few ideas on how to tackle implicit relations - my current plan of attack would be to treat the relation as one big expression, evaluate it for a grid of points, and then somehow extract the edges where it changes sign (marching squares?). This would probably be slow as hell in VB, and I'm reluctant to add a feature that isn't going to work as it should, but I might start on it when I get back from rowing tomorrow :) [editline]9th December 2011[/editline] [QUOTE=ROBO_DONUT;33646679]Well you're no fun :|[/QUOTE] That was just the initial awed reaction, off to bed soon so took a while to type out the reply on my phone :/ Does... does that equation actually draw Batman? Honestly and truly? I searched when murk mentioned it but I only found one for the bat symbol.
What's a good 2D library for C# besides XNA? I've tried SFML.NET and SDL.NET, but there's not enough samples.
[video=youtube;ztHlQn8cBMs]http://www.youtube.com/watch?v=ztHlQn8cBMs[/video] So, this is really my first time doing anything much outside of Java. I'm using LOVE2D to make my own little physics game just for the learning experience. This being said, obviously I'm not using LOVE's included physics library. My main issue right now is my implementation of gravity causing everything to vibrate and never become truly still, especially when the value of gravity is very large Also, the balls just use a modified type of basic bounding box collisions, which becomes fairly apparent when a ball hits a corner of the magical floating rectangle. After I lay down to try and get rid of my migraine I'm going to work on collisions between balls and hopefully stop the balls from using bounding box collisions. I already found an algorithm that looks promising, it is just a matter of implementation. Maybe I'll even get around to making a type of vector class, well as close as you can get to a class in lua. Also, thanks for this inspiration guys; I love reading this thread. Oh yea, the balls sticking to the side of the wall are due to my hacky way of keeping balls from flying outside of the map when they have a huge velocity.
What's a good XNA book (or documentation) that really explains things extremely in depth? I have lots of trouble learning something new if I don't understand parts of it.
So I was just starting to get into GitHub to upload some of my older projects that were sitting around, and I wanted to look at some other repos, and the first thing I saw was a project "webos" by "hpwebos" Turns out that as of today HP decided it would open source WebOS. There's no code up yet, I'm guessing it'll be up by tomorrow at the latest. (unless they still have to do a bunch of documentation/cleaning up still) [url]https://github.com/hpwebos/webos/wiki/Press-Release[/url]
Preferably both 2d and 3d.
[QUOTE=r0b0tsquid;33646693] That was just the initial awed reaction, off to bed soon so took a while to type out the reply on my phone :/ Does... does that equation actually draw Batman? Honestly and truly? I searched when murk mentioned it but I only found one for the bat symbol.[/QUOTE] It's only the bat symbol, taken from Wolfram Alpha's [url=http://www.wolframalpha.com/input/?i=batman+equation]page about it[/url]. I think the original equation is from [url=http://i.stack.imgur.com/VYKfg.jpg]this picture[/url]. And the [url=http://forums.xkcd.com/viewtopic.php?f=17&t=73065]xkcd thread[/url] about it has some written down versions of the equation.
[QUOTE=robmaister12;33647049]So I was just starting to get into GitHub to upload some of my older projects that were sitting around, and I wanted to look at some other repos, and the first thing I saw was a project "webos" by "hpwebos" Turns out that as of today HP decided it would open source WebOS. There's no code up yet, I'm guessing it'll be up by tomorrow at the latest. (unless they still have to do a bunch of documentation/cleaning up still) [url]https://github.com/hpwebos/webos/wiki/Press-Release[/url][/QUOTE] They have said that some of there code is not open-sourcable so they need to work on replacing those sections of code first.
Found a weird bug in my code. (with gwen and sfml) If I set the sf::Window back to it's default view before rendering the canvas, it only renders the text, not the box around it. However, moving the setview line after the render canvas line it works fine.
Sorry, you need to Log In to post a reply to this thread.