Isometric Projection

Get help using Construct 2

Post » Fri Jan 17, 2014 10:12 pm

You get the motion because x and z are being changed every time and their values are used in the formulas.

Here is the reference I used:
http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/2drota.htm
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sat Jan 18, 2014 6:54 am

I played around with my original capx and came up with a few adjustments. It will now spawn 3 spherical solar systems at random locations in the window with a y rotational axis, and different rotational speeds. Looks neat...

https://app.box.com/s/1wg9v4gwqel5ligldu0d
B
192
S
6
G
7
Posts: 213
Reputation: 10,178

Post » Tue Jan 28, 2014 3:13 am

OH ok we're talkin' about the angle of rotation...delta angle... which is a constant... not the total angle.

x is always going to be R*cos(angle) but if we're going from x to x' then it's
the derivative of Rcos(angle) which is cos(angle)^2-Rsin(angle)^2

R*cos(angle)*cos(angle) - R*sin(angle)*sin(angle)

substituting since y=r*sin(angle) we can substitute and get

R*cos(angle)*cos(angle) -y*sin(angle)

and since x = cos(angle) [I'm taking baby steps here]

we can substitute more

x*cos(angle)-y*sin(angle)

BOOM!
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
38
S
9
G
3
Posts: 149
Reputation: 5,986

Post » Tue Jan 28, 2014 5:26 am

Ugh... My head hurts now... I am glad someone is learning from this post. LOL!!!! (P.S. Im still not 100% on it myself, but at least I understand the basics.
B
192
S
6
G
7
Posts: 213
Reputation: 10,178

Post » Tue Jan 28, 2014 1:21 pm

I don't fully get how they come up with the second part either, the derivative... I just looked it up and it's that. There's a proof but phew I'm glad someone else did it.
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
38
S
9
G
3
Posts: 149
Reputation: 5,986

Post » Mon Dec 01, 2014 9:29 am

@R0J0hound
Your reference does not work for Z-Rotation.
Your "isometric Racer" doesn't hit the right Angel "45°"

Search for:
Choosing the correct isometric character facing direction.
What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Isometric graphics in video games and pixel art (wikipedia)

Can you please create a capx for it? ...resulting in these axes following a 26.565° (arctan 0.5) angle to the horizontal.
Example:
I only wanna set a variable like 45° and your event transform it to isometric Z-Rotation and set the playercontrol to this angle.
Playable games:
http://jamesxxxyz.newgrounds.com/
Newest: Blue and red arrows
Latest update: Blue and red arrows

What you want in C3?
viewtopic.php?f=146&t=122050

Youtube: https://www.youtube.com/channel/UCLE7Ml ... /playlists
B
11
S
4
Posts: 281
Reputation: 1,543

Post » Mon Dec 01, 2014 5:57 pm

@JamesXXXYZ
It does. Since it's using x and z it's rotating around the z axis. Use x and z for y axis rotation, and y and z for x axis rotation.

You can convert an angle to the closest 8 direction with
viewtopic.php?t=65352&start=0

You can convert an angle to an iso projected angle with
angle(0, 0, cos(a), sin(a)/2) where a is an angle.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Dec 01, 2014 11:01 pm

@R0J0hound
Your 8 way example is completly wrong
Your (?) isoracing example miss the right diagonal axis around 3°.

24_way direction.png


Can you put this in events for game isometric please?
(I only wanna write x°, y°, z°)

The best is to calculate the game in 3D and then simply project it into isometry.

const angle:Number = Math.PI/3;//you may want to tweak this one
const xVec:Point = Point.polar(-Math.PI/2 + angle, 1);
const yVec:Point = Point.polar(-Math.PI/2 - angle, 1);
const zVec:Point = new Point(0, -1);
............................
transform 3D to 2D:

function transform(x:Number, y:Number, z:Number):Point {
return new Point(x*xVec.x + y*yVec.x + z*zVec.x, x*xVec.y + y*yVec.y + z*zVec.y);
}
............................

I uploaded on my Youtube channel two isometric examples, both are in "Real" isometric view.
Is the speed reduction from 0° to 90° linear?

8 Way? No.
Sprites with walk cycle i wanna have 24 Way (min). Without 40 Way (min), I'm thinking about 360 Way. My highest rotation test was by 120 Way.
You do not have the required permissions to view the files attached to this post.
Playable games:
http://jamesxxxyz.newgrounds.com/
Newest: Blue and red arrows
Latest update: Blue and red arrows

What you want in C3?
viewtopic.php?f=146&t=122050

Youtube: https://www.youtube.com/channel/UCLE7Ml ... /playlists
B
11
S
4
Posts: 281
Reputation: 1,543

Post » Tue Dec 02, 2014 12:14 am

So the 8 direction capx doesn't work right for isometric. I can see that, which isn't a problem since it wasn't made with isometric in mind.

So the problem becomes how to find the closest angle as in your image. There probably can be an elegant formula to do it nicely, but barring deriving that you can check against all those angles to see if it's close.

But wouldn't it be simpler to do all the motions from a top view and set all the visible stuff to an isometric projection? Then the 8 direction capx is perfectly applicable. I doesn't matter that 45 is an animation drawn at 22.5 degrees, because when the angle of motion is changed from to view to iso it will be 22.5.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Dec 02, 2014 1:45 am

@R0J0hound
I guess it doesn't work (I saw other examples of isometric view[Construct 2]). Problem is that isometric rotation is not linear. I don't know if the iso pathfinding demo has correct rotation and speed. I guess every example which content sin and cos aren't real iso projection. I have no problem to render things out in isometric view. Use my example 24 Way picture and load it to your 8 Way example. I don't really understand the theory behind isometric and i'm not a programmer.
Playable games:
http://jamesxxxyz.newgrounds.com/
Newest: Blue and red arrows
Latest update: Blue and red arrows

What you want in C3?
viewtopic.php?f=146&t=122050

Youtube: https://www.youtube.com/channel/UCLE7Ml ... /playlists
B
11
S
4
Posts: 281
Reputation: 1,543

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests