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.
 
  • Locked thread
Jewel
May 2, 2009

SharpenedSpoonv2 posted:

In trying to make a very simple Geometry Wars clone in between 'good'/original ideas, I wanted to make enemies tilt towards their direction of travel. Turns out making 3D things rotate in 3D, but move in 2D is hard :V


If you didn't work it out yet, I'm thinking this comes from translation then rotation. Try rotation then translation. You'll be rotating around the origin, so if you translate first the origin is far away, leading to the orbiting effect!

Adbot
ADBOT LOVES YOU

Jewel
May 2, 2009

I was trying to bend traintracks













Edit: In progress fixing it to work without deformation in the last gif, but something is still Very Wrong



Edit2: Bah, still can't get it

Jewel fucked around with this message at 01:06 on Dec 22, 2014

Jewel
May 2, 2009

Going to bed so I'll paste what I wrote up on my blog and get back to any further questions later!

quote:

There’s some deformation in between transitions, but any other methods I try have far worse. This method was done using polar coordinates, where the angle was the x coord (0 to 1 space) converted to 0 -> 90 degrees, and the length was the y coord. From there the new x or y coords is just cos or sin(angle) * length.

The deformation comes in from the fact that lowering the angle in polar coordinates doesn’t lower the “bend” angle, just the area it’s mapped to, so you get this problem if you lower it: http://i.imgur.com/B59GdTN.gif

To offset that I just had to lerp between completely rotated and no rotation, so the lerp doesn’t really respect any distances so it deforms.


The closest method I’ve got to avoid deformation looks like this: http://i.imgur.com/fu9rWok.gif

It’s not deformed in that the spacing between the rails never changes, but the problem is that it bends in entirely the wrong ways. This was just done by rotating the entire space by 90 * x degrees, which leads to the end points being perfect but everything in between suffering.

Oh well! It was a fun exercise, I’d love to apply it to a 3D set of points some time but I don’t have much purpose for the code, it’s more efficient artistically to just model a unique bent model rather than bending via code.

But yes, this is entirely just procedural on point data, not necessarily any special "tracks" or "sleepers". That's one of the reasons I wouldn't really use this in anything too, it's more efficient to just model it because you get cleaner non-tapered sleepers.

Jewel
May 2, 2009

betalarmannen posted:

First one looks correct - I guess the problem lies in saving the blocks as polygons and then transforming those polygons. Any system is going to warp them, and it will look wrong. I'd save the blocks as just two endpoints through all the transformations, and add thickness later.

Edit for new page, I'm talking about this:


It's not the sleepers that's the deformation, I know they'll always deform and it's not realistic, I'm talking about at the 45 degree angle the exposed end of the track is all squashed and short. Though that endpoint tracking + thickness idea is neat.

Jewel
May 2, 2009

LP0 ON FIRE posted:

It's weird. It's like a rectangular area clears out what's drawn earlier, but on the way down it keeps what was there the frame previously. What is actually going on?

I'm guessing it clears where you currently are not where you last were which means on the way down it leaves a trail.

Adbot
ADBOT LOVES YOU

Jewel
May 2, 2009

DeathBySpoon posted:



That's... not quite how I intended buildings to come out.

This is really cute and I love the style and want to play this a ton!!

  • Locked thread