• What are you working on? November 2011 Edition
    3,673 replies, posted
Added tearing [img]http://i.imgur.com/XjeMZ.gif[/img] works pretty good
[QUOTE=icantread49;33293722]Added tearing [img]http://i.imgur.com/XjeMZ.gif[/img] works pretty good[/QUOTE] I still can't wrap my head around the fact that real time cloth physics exists.
[QUOTE=Jookia;33293926]I still can't wrap my head around the fact that real time cloth physics exists.[/QUOTE] ... on an ipod touch [b]2g[/b] :v: 533 MHz CPU and 128 MB of ram
Playing around with my maze program. Got it to display colours based on it's g-score. The further away it is from the start, the more blue it gets. The Green is the solved path. Brings a neat perspective to dfs mazes. [img]http://i.imgur.com/XYXOA.png[/img]
There, completed the pins and the blocks now: [url]http://gwttestkitty.appspot.com/[/url]
[QUOTE=icantread49;33293722]Added tearing [img]http://i.imgur.com/XjeMZ.gif[/img] works pretty good[/QUOTE] That's some damn heavy cloth. Weaved from platinum or some dense shit.
yeah it only updates at 30 Hz and it does 2 position correction iterations per step which results in that very "heavy" cloth then again, it's fun to have "heavy" cloth so you can tear it and stuff ... i did try making things more stiff (180 Hz and 5 position correction iterations) and it does look more realistic but the tearing just isn't fun anymore
I've been up for 16 or hours or so, and I'm not going to bed as I just went to the dentist and I don't want to bite my tongue off and choke on it while I'm asleep. Anybody else following the Desura FOSS thing? The dude says the code itself is ready for release, but he's still got shit to do.
[QUOTE=icantread49;33295069]yeah it only updates at 30 Hz and it does 2 position correction iterations per step which results in that very "heavy" cloth then again, it's fun to have "heavy" cloth so you can tear it and stuff ... i did try making things more stiff (180 Hz and 5 position correction iterations) and it does look more realistic but the tearing just isn't fun anymore[/QUOTE] If it's going to be a toy app, then there is nothing wrong with a shitload of options and customizations.
[QUOTE=Map in a box;33295234]If it's going to be a toy app, then there is nothing wrong with a shitload of options and customizations.[/QUOTE] oh yeah i forgot about that, i'm gonna have an options screen - update frequency - position correct iterations - resolution - how easy it is to tear - gravity - etc. [editline]16th November 2011[/editline] oh and of course, the image displayed
Add flag options so you can tear and burn the flag of your favorite or most hated country
[QUOTE=Map in a box;33295331]Add flag options so you can tear and burn the flag of your favorite or most hated country[/QUOTE] cool idea am i legally allowed to do that?
[QUOTE=Ehmmett;33295390]are there accelerometer gravity/wind stuff in the cloth sim?[/QUOTE] yeah you can tilt it to change gravity there's no wind (yet)
[QUOTE=Ehmmett;33295455]It'd be neat if you could blow into the iPhone's mic for wind. just a thought.[/QUOTE] not just a thought, but a really cool thought i'm gonna have to hold out on that till most of the other stuff is done though because my ipod touch 2g doesn't have a mic :v: [editline]16th November 2011[/editline] [img]http://i.imgur.com/0VI3M.png[/img] oops [editline]16th November 2011[/editline] i'm gonna try to add lighting to it [editline]16th November 2011[/editline] i'm surprised i got this far in only 2 days of work, who knew cloth simulations were so ... easy :v:
I'm sure its legal, I mean, why wouldn't it be? :v:
Here is a summary of what I've been working on for the past 2-3 months. I've been teaching myself how to simulate physics for 2D Convex polygons. I currently know only two types of physics engines: -Particle(Mass aggregate) physics engines. -Rigid body engines. In my Experience, I'd say attempting to program a rigid body engine is much harder than particle engines. The closest I've come to a completing a full 2D rigid body engine is here: [video=youtube;4fJQcKVwVMM]http://www.youtube.com/watch?v=4fJQcKVwVMM[/video] (I could post footage of my current build,with hard shadows and slight improvements,but i think this is good enough). There is a lot, that is wrong with this rigid body engine(if you can call it that). I can list of few things that are missing: -no static friction. -no impulses. -no moment of inertia calculations. -My Euler integration is probably flawed. - I cant figure out how to convert this equation into code: [IMG]http://upload.wikimedia.org/wikipedia/en/math/b/9/3/b937665c445bb62c92f2fb8a318fb99a.png[/IMG] -Other stuff I've missed. Eventually, i gave up on rigid bodies all together(rage quit), and moved onto particle Physics; Which in my opinion, is much easier to digest because i dont have to split up the equations into linear and angular components. Here is what I've done so far with my Particle physics engine: [these videos are fuzzy because i think i have to adjust the viewport in Opengl] [video=youtube;HikXeN7yS0I]http://www.youtube.com/watch?v=HikXeN7yS0I&list=PLA0179857631A949F&index=14&feature=plpp_video[/video] This video is just shows typical collision and stacking And the one below shows off Rope Constraints. [video=youtube;Lnvhj1SSs9M]http://www.youtube.com/watch?v=Lnvhj1SSs9M[/video] The language used is C++. The API for the window is SDL. The graphics API(i guess its a language too) is opengl. For the broad-phase collision, I'm going to be using a multi-resolution grid(Its basically a Quadtree but slightly worse). I was originally going to use java to do this stuff,however, there is no operator overloading in java so i made the switch to C++.
[QUOTE=ROBO_DONUT;33290037]The ability to load an entire flat data structure in two lines of code. In C, it's as simple as: 1. Define a struct (be careful with packing) 2. Call read(buffer, count, sizeof(type)) The entire structure gets filled with data [i]exactly as it appears in the file[/i], bit for bit.[/QUOTE] ...except if your machine is a different endianness than the one that created the file, all the numbers in your structure are wrong. And depending on your compile options, the in-memory layout of your struct might not actually match what's in the file. Anyway, Java is mainly used for business applications, which have little need for reading and writing binary files. The strength of the Java platform isn't the language (as a language, it's actually pretty bland), it's the high-level libraries like the servlet API that let are useful for "rapid application development" of business software. It's [i]not[/i] an ideal language for low-level stuff like what you're apparently doing, but it does have its strengths. BTW, take a look at the [url=http://download.oracle.com/javase/7/docs/api/java/io/DataInputStream.html]DataInputStream[/url] class. You don't have to do all the bit-shifting yourself.
added lighting to the cloth simulation [img]http://filesmelt.com/dl/cloth_lighting_better.gif[/img] todo: - options screen - pick picture from photo library - wind
[QUOTE=TheCoast47;33295917]I cant figure out how to convert this equation into code: [IMG]http://upload.wikimedia.org/wikipedia/en/math/b/9/3/b937665c445bb62c92f2fb8a318fb99a.png[/IMG][/QUOTE] Should be something like: [code] float numerator; float denominator; for (int i=0; i<n-1; i++) { numerator += length(cross(P[n+1], P[n])) * (dot(P[n+1], P[n+1]) + dot(P[n+1], P[n]) + dot(P[n], P[n])) denominator += length(cross(P[n+1], P[n])) } float I = m / 6.0 * numerator / denominator; [/code] There's probably some optimization that could be done there, but I think that's the gist of it. [editline]16th November 2011[/editline] If you're working in 2D, I don't know if the cross-product operator is defined. You probably have to treat the vectors as 3D with z=0. [editline]16th November 2011[/editline] [QUOTE=Wyzard;33296194]...except if your machine is a different endianness than the one that created the file, all the numbers in your structure are wrong. And depending on your compile options, the in-memory layout of your struct might not actually match what's in the file.[/QUOTE] How many strictly big-endian systems are actually in use today? My guess would be very few. The x86 is little-endian, Macs have switched to x86 from PPC, so PPC is pretty much dead, phones and tablets generally run ARMs in little-endian mode, many (if not most) microcontrollers are little-endian, including everything from Atmel (and the Arduino, by extension). So big-endian is getting pretty obscure. What is the likelyhood that you'll actually be porting anything to big-endian? So yeah, you [i]should[/i] be writing clean code that checks endianness and reorders bits accordingly, but, practically, you can pretty much assume the system is little-endian without getting yourself into too much trouble unless you're specifically planning to run on a big-endian platform.
...and yeah, you [i]should[/i] be writing clean code that distinguishes between integers and pointers, and never store a pointer in an int variable, but practically, you can pretty much assume they're the same size without getting yourself into too much trouble unless you're specifically planning to run on a 64-bit platform. Times change. What seems like a safe assumption now can lead to bugs and portability headaches a few years down the road when suddenly you [i]do[/i] want to support the thing you always assumed you wouldn't need to.
[QUOTE=ROBO_DONUT;33296377]Should be something like: [code] float numerator; float denominator; for (int i=0; i<n-1; i++) { numerator += length(cross(P[n+1], P[n])) * (dot(P[n+1], P[n+1]) + dot(P[n+1], P[n]) + dot(P[n], P[n])) denominator += length(cross(P[n+1], P[n])) } float I = m / 6.0 * numerator / denominator; [/code] There's probably some optimization that could be done there, but I think that's the gist of it. [editline]16th November 2011[/editline] If you're working in 2D, I don't know if the cross-product operator is defined. You probably have to treat the vectors as 3D with z=0. [editline]16th November 2011[/editline] How many strictly big-endian systems are actually in use today? My guess would be very few. The x86 is little-endian, Macs have switched to x86 from PPC, so PPC is pretty much dead, phones and tablets generally run ARMs in little-endian mode, many (if not most) microcontrollers are little-endian, including everything from Atmel (and the Arduino, by extension). So big-endian is getting pretty obscure. What is the likelyhood that you'll actually be porting anything to big-endian? So yeah, you [i]should[/i] be writing clean code that checks endianness and reorders bits accordingly, but, practically, you can pretty much assume the system is little-endian without getting yourself into too much trouble unless you're specifically planning to run on a big-endian platform.[/QUOTE] Playstation 3, Xbox 360, Wii, and Wii U to name a few.
[QUOTE=icantread49;33295466]i'm surprised i got this far in only 2 days of work, who knew cloth simulations were so ... easy :v:[/QUOTE] A few months ago I accidentally created a cloth simulation :v: [media]http://www.youtube.com/watch?v=SYnAFm7LeTc[/media]
[QUOTE=Robber;33298238]A few months ago I accidentally created a cloth simulation :v: [media]http://www.youtube.com/watch?v=SYnAFm7LeTc[/media][/QUOTE] I wish my accidents were that awesome.
What were you trying to make?
So this girl wants me to help her study for a java test. How fucking awesome is it that somebody I know actually takes a programming class? Let alone a female. Except it's java...
[QUOTE=Robber;33298238]A few months ago I accidentally created a cloth simulation :v: [media]http://www.youtube.com/watch?v=SYnAFm7LeTc[/media][/QUOTE] that's really cool :) did you just render lines for the edges? actually triangulating it (while still respecting broken edges, etc.) is a major pain :v:
[QUOTE=Yogurt;33299057]So this girl wants me to help her study for a java test. How fucking awesome is it that somebody I know actually takes a programming class? Let alone a female. Except it's java...[/QUOTE] Could be worse. It could be [i]HTML[/i].
[QUOTE=vexx21322;33299146]Could be worse. It could be [i]HTML[/i].[/QUOTE] Yeah.. it's stupid to learn the most used language on the web.
[QUOTE=theJohn;33299177]Yeah.. it's stupid to learn the most used language on the web.[/QUOTE] Who really [I]uses[/I] it anymore, it's more of a vessel for css and javascript.
Now I can draw 1500 Sprites with a VBO (more Sprites than SFML.Net 2.0 and XNA) instead of 500 with immediate mode. Thats OK for now but I think I should be able to draw more.
Sorry, you need to Log In to post a reply to this thread.