Author Topic: Help me with creating an equation  (Read 890 times)

Before you ask, no, this isn't for homework. It's for my game.

I've been trying to make an equation for the past hour or so probably and I haven't had any luck. I even tried asking several of my steam friends but I've had no luck. It's pretty difficult to make, but I'm pretty sure that its possible. I came to the forums hoping someone would be able to make it.

The equation needs to be arranged as: Z = X + Y + or * other stuff.
It needs to work for the sets: (1,-1,180), (-1,-1,90), (-1,1,0), (1,1,-90) where (X,Y,Z).

If you want me to elaborate, just ask.

Im...
Not entirely sure what you're asking for.

Im...
Not entirely sure what you're asking for.

He wants assistance in creating the formula z(x, y), where z(1, -1) = 180, z(-1, -1) = 90, z(-1, 1) = 0 and z(1, 1) = -90.
« Last Edit: May 19, 2012, 02:09:14 AM by Port »

He wants assistance in creating the formula z(x, y), where z(1, -1) = 180, z(-1, -1) = 90, z(-1, -1) = 0 and z(1, 1) = -90.
well I've no idea what's going on anymore

He wants assistance in creating the formula z(x, y), where z(1, -1) = 180, z(-1, -1) = 90, z(-1, -1) = 0 and z(1, 1) = -90.
My brain just melted.

well I've no idea what's going on anymore

Degree rotation.
1  1: -90 degrees rotated
-1  1: 0 degrees rotated
-1-1: 90 degrees rotated
1-1: 180 degrees rotated

It's simple.

We kill the fatman.

looks to me like you have an offset basic units circle with a radius of root 2 instead of 1

A standard unit circle will look like: (1, 0, 0), (0, 1, 90), (-1, 0, 180), and (0, -1, -90) and the equation for it in torque is matan(y,x)*(180/3.14159265)

However, your circle is offset by 3pi/4 radians or 135 degrees, so you will need to add that on afterwards.

This stuff is super prevalent in the color selector of my Too Many Bricks Inventory mod on RTB if you would like to take a closer look.
« Last Edit: May 19, 2012, 02:16:18 AM by Nexus »

looks to me like you have an offset basic units circle with a radius of root 2 instead of 1

A standard unit circle will look like: (1, 0, 0), (0, 1, 90), (-1, 0, 180), and (0, -1, -90) and the equation for it in torque is matan(y,x)*(180/3.14159265)

However, your circle is offset by 3pi/4 radians or 135 degrees, so you will need to add that on afterwards.

This stuff is super prevalent in the color selector of my Too Many Bricks Inventory mod on RTB if you would like to take a closer look.
I've been using a formula to find the angle on walls, which sounds like what you're talking about.
It is Z = ((x * 90 * -1) - 90 + (y * -1 * 90))
You're saying I should add 135 to that? That doesn't work in the slightest.

what in the godly forget?
you guys sound like the stereotypical "smart guys" correcting each other in some Disney show

what in the godly forget?
you guys sound like the stereotypical "smart guys" correcting each other in some Disney show
Can't tell if that's a compliment or an insult.
Also, damn Nexus is offline. Guess I'll go look at his code.


Can't tell if that's a compliment or an insult.
well, it's a compliment in that I'm saying you sound really smart, and I don't doubt that you are
and it's not really an insult in any way, but it was a little bit of a joke

I've been using a formula to find the angle on walls, which sounds like what you're talking about.
It is Z = ((x * 90 * -1) - 90 + (y * -1 * 90))
You're saying I should add 135 to that? That doesn't work in the slightest.


No you are writing an algebraic equation
I'm saying it looks like you should use trig, but you only gave me 4 points to work with

the arctangent of y/x should give you what you want, offset by 135 degrees

No you are writing an algebraic equation
I'm saying it looks like you should use trig, but you only gave me 4 points to work with
They aren't points. I'll try to explain.
Okay so basically theres this box. You face a side and press f. It shoots out some traces and determines the normal of the wall which is shown on each angle. its (x,y,0), Not Z. The Z is the degree the character needs to be rotated to
Here's a diagram:
http://puu.sh/vxmx
To the right is 0 degrees.