Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Vanadium posted:

Now I just need to figure out how to make it click-throughable. :smith:

Use the X Shape extension and shape the input region away. In C:

code:
cairo_region_t *input_region;
input_region = cairo_region_create ();
gdk_window_input_shape_combine_region (gtk_widget_get_window (widget),
                                       input_region, 0, 0);
cairo_region_destroy (input_region);

Adbot
ADBOT LOVES YOU

Vanadium
Jan 8, 2005

Amazing, I'd read about that extension but the whole X thing scared me away, and no one I asked knew where to look for it in Gtk. :3:

Edit: Apparently that only blocks the window from accepting focus/being brought to the foreground by clicking on it, but I really want to let clicks go through to the windows that are already below it. Sounds like my shape thing is broken!!

Edit: Found some example C code that didn't work as advertised but was click-through anyway. welp.

Vanadium fucked around with this message at 05:20 on Dec 28, 2011

gonadic io
Feb 16, 2011

>>=
Baby's first game:

Two days into creating a game with Haskell and OpenGL (both of which I'm already familiar with), mostly as something to keep me busy

So far I have:
- hex based movement
- A*ish pathfinding
- impassable terrain
- drawing boards and paths
- changing the ends of the path with the keyboard

https://github.com/Swooshed/Game-of-Hexes

If anybody has any suggestions or code improvements, I'd love to hear them.


VVVVVV: a two-coordinate system, where the two axes are | and /. Movement in the \ direction is a combination of movement in the other two. See HexGrid.hs for a comment explaining it in more depth. Something a bit like the first image in this answer but rotated 90°.

gonadic io fucked around with this message at 18:43 on Dec 28, 2011

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

AlsoD posted:

Baby's first game:

Two days into creating a game with Haskell and OpenGL (both of which I'm already familiar with), mostly as something to keep me busy

So far I have:
- hex based movement
- A*ish pathfinding
- impassable terrain
- drawing a board and a path
- changing the ends of the path with the keyboard

https://github.com/Swooshed/Game-of-Hexes

If anybody has any suggestions or code improvements, I'd love to hear them.

What's your internal representation of the Hexes? (i.e. coordinate system)

o.m. 94
Nov 23, 2009

Quick and dirty visualisation of the Mandelbrot set using pygame. Code is here if anyone is interested or has any suggestions to make. Next I need to put it in an event loop and give mouse control to move about / zoom.

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

oiseaux morts 1994 posted:

Quick and dirty visualisation of the Mandelbrot set using pygame. Code is here if anyone is interested or has any suggestions to make. Next I need to put it in an event loop and give mouse control to move about / zoom.



Lovely!

Grabulon
Jul 25, 2003

oiseaux morts 1994 posted:

Quick and dirty visualisation of the Mandelbrot set using pygame. Code is here if anyone is interested or has any suggestions to make. Next I need to put it in an event loop and give mouse control to move about / zoom.



Color each pixel not in the mandelbrot set based on the number of iterations it takes to find it out.

And if you want to get fancy:

http://en.wikipedia.org/wiki/Mandelbrot_set#Continuous_.28smooth.29_coloring

o.m. 94
Nov 23, 2009

Grabulon posted:

Color each pixel not in the mandelbrot set based on the number of iterations it takes to find it out.

That took longer to work out than I thought! :downs:

o.m. 94 fucked around with this message at 15:54 on Jan 1, 2012

evensevenone
May 12, 2001
Glass is a solid.
Color the inside of the set by the periodicity of the orbit that the series converges to.

o.m. 94
Nov 23, 2009

evensevenone posted:

Color the inside of the set by the periodicity of the orbit that the series converges to.

Actually if you look closely, I'm invoking the unramified Galois p-module over the extended reals in Sigma_e to determine the co-cycles, all of which are reducible in C and thus have points that are rendered black

Posting Principle
Dec 10, 2011

by Ralp

Thermopyle posted:

I started out writing this in python because I like python. Unfortunately I discovered that GUI programming with python on Windows 7 is poo poo. To quote myself:

:python gui stuff:

Have you tried PyQt? Admittedly my only Qt experience is C++, but Qt apps look great on Windows, and PyQt is fairly mature and well supported.

edit: You get the added benefit of being able to use Qt Designer and lay things out visually.

Posting Principle fucked around with this message at 02:38 on Jan 2, 2012

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal
Pyside has the same benefit, it's basically pyqt but with a more liberal license (LGPL) and a nicer api. There's a snippet for loading a qt designer form file on the wiki.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

computers posted:

Have you tried PyQt? Admittedly my only Qt experience is C++, but Qt apps look great on Windows, and PyQt is fairly mature and well supported.

edit: You get the added benefit of being able to use Qt Designer and lay things out visually.



SavageMessiah posted:

Pyside has the same benefit, it's basically pyqt but with a more liberal license (LGPL) and a nicer api. There's a snippet for loading a qt designer form file on the wiki.

Yeah, I wanted the LGPL licence. You can't get introspection on PySide on Windows yet, so I didn't use it because I get irrationally irritated when I can't use the latest versions of something.

Huragok
Sep 14, 2011
I did a quick 'n' dirty javascript benchmark with https://cloudlab.io today. It turns out that the CLR-bound math is faster than the latest browsers. That's a good thing, and I haven't even begun optimization. But then again, homebrew benchmarks can be wrong. That and I'm sure that those js arrays are sparse ones (which would be inferior, discounting all that JIT poo poo).

Dred_furst
Nov 19, 2007

"Hey look, I'm flying a giant dong"
Been working on this for my robotics coursework, and I'm pretty pleased with how it's starting to turn out.

The rightmost window is the robot simulator I'm using for testing, Bottom left is the program that actually controls the robot, it follows a wall to some degree and collates telemetry from the robot. Top right connects via tcp/ip to the robot program to collect the telemetry and render it on the window in the middle.

Things I've got to do still, some more behaviors as well as some proper mapping.

feedmegin
Jul 30, 2008



I've been working on a Mobipocket/Kindle-compatible ereader, written in C++/Qt, for CV/yes-I-can-prove-I-can-code-here's-my-github purposes - I'm looking to move back to the UK from America, preferably to Oxford, in the near future.

Not much to see in a screenshot, really, because it's an ereader, but here it is laying out text like a boss. I've been learning Latin lately, so I've added support for looking up words in a dictionary (more complicated than you'd think because Latin is highly inflected; you can't just go look up 'egisti' in the dictionary and find out it means 'I led/did' because the verb's going to be listed in the dictionary under 'ago'). I'm developing under desktop Linux and testing on my Android tablet, but it should work anywhere Qt does.

I also intend to add support for an overlay/filter that'll let me correct misspellings without actually altering the book file on disc. :)

feedmegin fucked around with this message at 17:28 on Jan 7, 2012

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal
It would be cool if you made it so that people could share their overlays so that you could find fixes for poorly edited books and such.

feedmegin
Jul 30, 2008

SavageMessiah posted:

It would be cool if you made it so that people could share their overlays so that you could find fixes for poorly edited books and such.

Yep, that's exactly the idea. Because the overlay is a separate file there are no copyright implications; basically you'd just drop the overlay file in the same directory as you keep your books (so /sdcard/kindle in the case of Android) and magically your book will suck less.

Winkle-Daddy
Mar 10, 2007
First attempt at doing some minecraft like terrain generation. Neat!



I do plan on building a game around this eventually, but right now my frame rate is in the shitter so I need to get this optimized before I go on to working on game play. I want it to be an unsettling survival horror game (hence the fog).

e: VVV Goddamn, that is awesome. I feel like I should delete the rest of my post in light of what followed mine. At least I didn't follow your post!

Winkle-Daddy fucked around with this message at 04:00 on Jan 8, 2012

steckles
Jan 14, 2006


Just fiddling with my ray tracer. I finally added material support to my .obj converter. The water is my addition, the rest of the model was found on ompf.

Wheelchair Stunts
Dec 17, 2005

feedmegin posted:

Yep, that's exactly the idea. Because the overlay is a separate file there are no copyright implications; basically you'd just drop the overlay file in the same directory as you keep your books (so /sdcard/kindle in the case of Android) and magically your book will suck less.

What part of copyright law says this is okay due to it being a separate file? I thought a derivative work is a derivative work?

SlightlyMadman
Jan 14, 2005

It may not be technically legal, but I've never heard of anyone being sued over it, since it still requires you to have your own (presumably legitimate) copy of the source material.

Wheelchair Stunts
Dec 17, 2005
Yeah, I was wondering why copyright was even brought into it. :) Just wanted to make sure we're all on the same page given the recent penchant for suing sue sue sue among content holders.

SlightlyMadman
Jan 14, 2005

I'm sure it's a violation of the DMCA somehow and you might have a problem if you released an overlay for Harry Potter that changed "wand" to "wang" or something.

Vanadium
Jan 8, 2005

steckles posted:


Just fiddling with my ray tracer. I finally added material support to my .obj converter. The water is my addition, the rest of the model was found on ompf.

Yeah I was just scrolling down this thread and idly wondering why someone would post a picture of their flooded kitchen in CoC...

Opinion Haver
Apr 9, 2007

Vanadium posted:

Yeah I was just scrolling down this thread and idly wondering why someone would post a picture of their flooded kitchen in CoC...

So was I, really nice work.

lord funk
Feb 16, 2004

yaoi prophet posted:

So was I, really nice work.

Yeah, I'm glad I'm not the only one. I love ray tracing. :allears:

Contains Acetone
Aug 22, 2004
DROP IN ANY US MAILBOX, POST PAID BY SECUR-A-KEY

Contains Acetone fucked around with this message at 17:56 on Jun 24, 2020

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

steckles posted:


Just fiddling with my ray tracer. I finally added material support to my .obj converter. The water is my addition, the rest of the model was found on ompf.

The water could use some work (rough as it is, it should have some breaks or collisions in the waves), but that's a drat nice raytracer. What's it called?

Toper Hollyphant
Jul 31, 2010

steckles posted:


Just fiddling with my ray tracer. I finally added material support to my .obj converter. The water is my addition, the rest of the model was found on ompf.

This looks awesome. The window reflection is what makes this so believable that brain actually thinks that this is a photograph..

feedmegin
Jul 30, 2008

SlightlyMadman posted:

I'm sure it's a violation of the DMCA somehow and you might have a problem if you released an overlay for Harry Potter that changed "wand" to "wang" or something.

My reader only handles unencrypted mobi files, so hopefully that puts any DRM/DMCA problems out of the picture, and as I see it it doesn't actually create or alter a work at all - the book on disc isn't being modified in any way, after all, you just get an alteration in what you see on-screen - it's more like when you use the annotation support some ereaders have.

That said, since I am only handling unencrypted files, that means I'm working with books that are either in the public domain (I can trust that Julius Caesar won't be taking me to court, I think) or where the author is releasing his stuff for free anyway (like Peter Watts) :)

Dred_furst
Nov 19, 2007

"Hey look, I'm flying a giant dong"

steckles posted:


Just fiddling with my ray tracer. I finally added material support to my .obj converter. The water is my addition, the rest of the model was found on ompf.

This is impressive, I thought it was a photo until I hit the water, it could probably do with being smooth. On closer inspection, the wall is far too smooth, so are the cupboards. that and the actual light source looks odd, apart from that it's impressive as hell.

Moey
Oct 22, 2010

I LIKE TO MOVE IT

Dred_furst posted:

This is impressive, I thought it was a photo until I hit the water, it could probably do with being smooth. On closer inspection, the wall is far too smooth, so are the cupboards. that and the actual light source looks odd, apart from that it's impressive as hell.

And the table is too close to open the fridge...

Pretty awesome, I had to double take to realize it wasn't a picture.

steckles
Jan 14, 2006

Dred_furst posted:

This is impressive, I thought it was a photo until I hit the water, it could probably do with being smooth. On closer inspection, the wall is far too smooth, so are the cupboards. that and the actual light source looks odd, apart from that it's impressive as hell.
Yeah, the water is just a simple noise function on a 1000x1000 grid. There are definitely much better functions for generating realistic looking water, but that's beyond the scope of a ray tracer. Same goes for the walls.


wellwhoopdedooo posted:

What's it called?
The program has the staggeringly creative name of "raytracer.exe". I really should think of something a bit better.

duck monster
Dec 15, 2004

Whats your render time for that?

e: Protip if you want to make some money off that thing. Heaps of architects (incl student architects) use Google Sketchup to do visualization for stuff. But sketchup doesnt really do realistic visualisation at all. Make a webservice that people can upload their sketchup drawings (you might need to do a plugin using the SDK to deal with materials) and get a render for, like , $15 or something and you'll have heaps of people using it, since the big name ray-tracers are horrifically expensive, and architects just want something they can poo poo out a realistic rendering they can give to a client. So write a plugin that lets them say "This is a wall, thats a floor, this is a roof, outside is some grass, and heres a pool" and do a few test renders (I dunno, make these free but watermarked and lower res) and then when happy get a big rear end rendering back to pitch a client with. Do it with a webservice at the backend so you can just bill by the render, and you'll make money hand-over-fist.

.....and then get aquired by autodesk.

duck monster fucked around with this message at 12:03 on Jan 9, 2012

akadajet
Sep 14, 2003

Vanadium posted:

Yeah I was just scrolling down this thread and idly wondering why someone would post a picture of their flooded kitchen in CoC...

"Man, those are some ugly green plastic chairs... oh! It's a raytracing!"

duck monster
Dec 15, 2004

Wheelchair Stunts posted:

What part of copyright law says this is okay due to it being a separate file? I thought a derivative work is a derivative work?

Copyright generally is about distribution rights, not useage rights. Generally useage rights are contractual grants of rights rather than copyright. Its a bit messy and the two tend to get mangled together in some of the more messier modern incarnations of "copyright" law like the DMCA and this loving SOPA abomonation being proposed.

Basically traditionally copyright just covered copying to someone else without permission. You where allowed to possess stuff you didn't pay for, and do whatever the gently caress you wanted with it, you just couldn't give it to people without permission. This was the same for patents too by the way (and I believe still is). You can violate the gently caress out of patents, you just cant distribute your derivitive invention.

One of the side effects of this when software started to come into the picture was EULAs where literally not worth the paper they where written on, and judges tended to basically say unless the person has signed a contract theres nothing in copyright law that makes a eula valid because copyright law does not affect useage, just distribution.

This of course meant that record companies gnashing their teeth about people making cassette tape copies of LPs they owned for listening to in the car did not get a particularly receptive audience with judges who where adamant that making copies for yourself is fine, because you can do whatever the gently caress you want with stuff as long as you don't give it to someone else.

So thats sort of why the DMCA came about with its restrictions on copy protection circumvention. Actually changing copyright law to allow EULAS to apply just by opening the packet (including the clusterfuck where the EULA is inside the packet, and you agree to it by opening it) really was going a bit too far and had a *LOT* of far reaching consequences outside of copyright (eg "by opening the packet to allow yourself to read this sentence you hae agreed that your house is now the posession of microsoft.") , having a click thru agreement seems a fairly good compromise. Arguably the click-thru always was valid (it was really shrink-wrap that was the problem), but there was a work-aroun where you could hack the code (rememeber until you agree with the eula, it doesnt apply!) so that it would install without you having to agree with it, which was perfectly valid pre DMCA.

Where it gets interesting is that in most of the world its STILL legal to download music(etc) you havent paid for , just not copy it to someone else. Which is why usenet is mostly legal for the downloader and torrents are mostly definately not legal (because your uploading to others). I don't know if this is the case in the US. But I've *never* heard of record companies going after usenet users or people downloading of :files: sites.

So in the case of an app that lets you read a possibly dodgy document and makes changes to it. As long as it doesn't crack the encryption or upload it anywhere, I'm pretty certain it does not violate the DMCA . Most PDF readers let you annotate PDFs, even ones with encryption on it, for instance.

Of course I'm not a lawyer, so don't take this as advice or you'll get in ridiculous amounts of trouble, probably.

steckles
Jan 14, 2006

duck monster posted:

e: Protip if you want to make some money off that thing. Heaps of architects (incl student architects) use Google Sketchup to do visualization for stuff. But sketchup doesnt really do realistic visualisation at all. Make a webservice that people can upload their sketchup drawings (you might need to do a plugin using the SDK to deal with materials) and get a render for, like , $15 or something and you'll have heaps of people using it, since the big name ray-tracers are horrifically expensive
Not a bad idea. Unfortunately, the render times are similar to commercial ray tracers like Maxwell for most realistic scenes. You're looking at 8-10 hours or more on a 4ghz quad core for a reasonably noise-free image. I guess you could do something with cloud computing to avoid the huge up front investment in computing power you'd need.

steckles fucked around with this message at 02:29 on Jan 10, 2012

duck monster
Dec 15, 2004

Yikes. That thing must be a total horror to debug.

Adbot
ADBOT LOVES YOU

Jewel
May 2, 2009

steckles posted:

Not a bad idea. Unfortunately, the render times are similar to commercial ray tracers like Maxwell for most realistic scenes. You're looking at 8-10 hours or more on a 4ghz quad core for a reasonably noise-free image. I guess you could do something with cloud computing to avoid the huge up front investment in computing power you'd need.

But then again, it doesn't matter if it takes the same amount of time; the customer doesn't have to pay an incredible amount of money to get a render done. Even if it takes a day, that's much better than paying lots of money.

Perhaps if you decided to do it, you could have some sort of system for, like, $15 for 720p, $25 for 1080p, $40 for a huge image? Just base the prices around how much it takes in electricity, and potentially invest in cloud computing if the service kicks off.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply