• Welcome to SpeedSolving.com — the world’s largest puzzle community!

    You’re currently browsing as a guest, which means you have limited access to discussions, resources, member profiles, and community features.

    Join 50,000+ cubers and puzzle enthusiasts from around the world to ask questions, share solves, improve faster, and be part of the community.

    Registration is free, fast, and easy — create your account today.

    Already a member? Log in here to hide this message and start participating.

Roofpig - A Canvas/Javascript web cube

Lars Petrus

Regular
Joined
Mar 22, 2009
Messages
68
WCA
1982PETR01
Back in the 90's I and others wrote Java applets to animate cubes on the web. It was cool technology at the time, but in 2014 they're almost unusable.

So I wrote a Canvas/Javascript based version for the modern web. Mostly so http://lar5.com/cube could be useful again, but also for anyone who wants animated cubes on their web site. It's called Roofpig, should be very easy to use, and lives on https://github.com/larspetrus/Roofpig.

Have fun!
 
Niiice. It's about time that cube java applets got either an update or kicked out.

Well done. Though, when it's turning it looks kind of... hole-y. (inb4 it's the Holy Cube) It's not a major problem, just an aesthetic thing.

Good work! :)
 
Woohoo! I'm not the only one!

I was going to rewrite the core part of twisty.js soon, since it's almost 3 years old. Making it an applet replacement was soon on the roadmap.
Let's collaborate or something.


First thought: Add some easing to your moves.
 
Woah! Thank you! I'm really glad to hear that.

Also, that's the website where I first learned about speedcubing, and I've learned my very first speedmethod, back at 2005... Aaaw, the old memories. :o
 
when I saw the name I remembered this:

 
Last edited by a moderator:
A second roof pig! Most unexpected!

Dane: The hole-y-ness stopped bothering me. Thanks for the reminder. It's not hard to fix but it not trivial either, and you can do it in a few different ways.

Lucas: I never even though of "easing" before. I'll put that in. Thanks!

If anyone needs Roofpig help, I'm very happy to answer questions here, at [email protected] or maybe even at https://github.com/larspetrus/Roofpig/issues
 
Dane: The hole-y-ness stopped bothering me. Thanks for the reminder. It's not hard to fix but it not trivial either, and you can do it in a few different ways.]
Well, I think the easiest way would be to make two double sided black planes appear on the inside when a turn in made. For example, if a B turn is made, then the black planes would appear between that slice and the rest of the cube before the slice starts to rotate. One plane will stay where it is, and the other plane will rotate with the side.

But if you don't have time, that's fine. It works as it is. You could even leave it for " holiness' " sake ;P
 
OK, I fixed the Holy-ness. It's live on lar5.com, but not in the official release file on Github.

Not sure how to best handle releases, but too often seems bad.
 
Hooray! I saw this on your site before it was properly announced, and I was glad that it replaced the Java applets. Those things are horrible. It was glitching up before, but those problems seem to have been fixed now.

I also like how you've changed the "made with a mac" gif to "powered by roofpig". This isn't 1998 any more.
 
Are you planning on adding support for setup + alg instead of always ending in a solved cube? Or perhaps, setting the color scheme / pov for the beginning of the solve rather than the end?

I ask because I think this has a lot of potential to use for reconstructing solves, which mostly have a fixed start pov rather than a fixed end pov. If you don't plan on doing this I'll fork the code and see what I can do, but my Ruby is pretty noob.
 
> Are you planning on adding support for setup + alg instead of always ending in a solved cube?

I hope you just didn't notice the setupmoves parameter? If not, what do you seek more precisely?

> Or perhaps, setting the color scheme / pov for the beginning of the solve rather than the end?

Hm... That's actually a bug!

It didn't occur to me that perspective changing moves (M, E, S, x, y, z etc) would affect pov and colors.
 
OK, I fixed the Holy-ness. It's live on lar5.com, but not in the official release file on Github.

Not sure how to best handle releases, but too often seems bad.

Looks how it appears on my PC:
cube_zps417f712e.jpg
 
Looks how it appears on my PC:

Thanks!

It looked very similar on my crappy old 2009 Netbook. I hope you also have a pretty old graphics card?

The reason is that the black "plastic" is too close to the sticker, and I guess the card doesn't have good enough resolution to fully separate them.

I made the sticker 6 times thicker, and now it looks OK (if not perfect) for me.
 
Nice! Now its working.

Also I have to say its a honor to meet such a great person like you that ivententend a great method.
 
Last edited by a moderator:
Maybe I missed that, but is it possible to play around with the cube? If I remember well, the old Java version allowed user-made movements. Not that I miss that feature, just asking.
 
Back
Top