# Can we stretch a layer? Isometric 3D engine

Get help using Construct 2

### » Mon May 04, 2015 6:00 pm

I fail to see how my example that newt quoted is wrong. It's the same as the transform in the op except everything is already rotated by 45. The second example quoted by christina is for a perspective transform, which isn't the same. The main difference is axes of motion in my example are relative to the screen instead of to the iso grid. Other than that christina's example is a valid iso transform.
B
97
S
36
G
131
Posts: 5,519
Reputation: 83,476

### » Mon May 04, 2015 6:11 pm

@newt yay! You got it in the end
@jobel yes totally this!
@Magistross another victory! Now I have to iron out the canvas placement, because there's some cropping due to the 45 degree rotation of the first one.

Also if there's an easier way to do it, @r0j0hound would know. Like if it was possible to paste a *rotated* layer onto the canvas object. But my tests indicate that a rotated layer gets pasted un-rotated into the canvas object. Maybe that's for the best anyway.
B
29
S
12
G
4
Posts: 193
Reputation: 4,606

### » Mon May 04, 2015 6:17 pm

@r0j0hound the reason I'm saying it's "wrong" is because the positions do not line up

If the black ball is on the tip of the first tile of the second row, then the grey (ortho) ball should be at the same tip, where the arrow points. No?
B
29
S
12
G
4
Posts: 193
Reputation: 4,606

### » Mon May 04, 2015 6:25 pm

That would be the case if the hot spot was at the bottom of the sprite, but it isn't. The black circle's hotspot is in the middle a of tile, so is the grey one.
B
80
S
33
G
27
Posts: 1,027
Reputation: 21,114

### » Mon May 04, 2015 6:44 pm

That's cosmetic, the transformation only transforms the object's origin. To complete the illusion of the circle being a sphere the circle's origin would need to be moved to the bottom.

In your capx you can fix it being off center by not moving the canvas' and have their origins be in the center.
canvas1: set angle to 0
canvas1: clear
canvas1: paste layer
canvas1: set angle to 45
canvas2: set height to 480
canvas2: clear
canvas2: paste canvas1
canvas2: set height to 240

You'll probably want to make canvas2's height to be twice the screen height so stuff will be drawn from the top to the bottom.
Still in order to not have empty triangles in the corners you'll have to make canvas1 much larger than the screen (that could probably be calculated but it's probably easier to guesstimate).
B
97
S
36
G
131
Posts: 5,519
Reputation: 83,476

### » Mon May 04, 2015 6:51 pm

@Magistross huh!
@R0j0hound crap I should have checked! It's not like I didn't know this happens. Apologies! Very cool And thanks for the tips.
B
29
S
12
G
4
Posts: 193
Reputation: 4,606

### » Thu May 07, 2015 9:46 pm

My concern with this kind of approach is the "squish by 50%" step is destructive to artwork drawn in planometric style. Linear sampling will blur pixels, and point sampling might inconsistently pick pixels depending on floating point scaling or positioning. It seems a better idea to just draw your artwork in isometric to guarantee pixel-perfect rendering.

There was a reason the engine doesn't support per-axis scaling of layers, but frustratingly I can't remember what it is...
Scirra Founder
B
413
S
244
G
92
Posts: 25,082
Reputation: 199,732

### » Mon May 18, 2015 10:14 am

Thanks @Ashley.
Linear sampling and blur would be an acceptable sacrifice in some cases, and it's a good trade-off for an engine that doesn't need isometric math. But yes, it will be less pretty
B
29
S
12
G
4
Posts: 193
Reputation: 4,606

### » Thu Nov 10, 2016 5:12 pm

Thank you so much for this thread, exactly what I looking for today!

How do I then trim off the excess black area?

I'm using this "planometric to fake isometric" technique, and I've added offsets to the canvas positioning to mimic 'system-Scrollto-player' so my maze appears to be moving around my character. I'd like to zoom in or trim the excess screenspace but I don't understand the canvas object well enough to know if I can do this within the structure as it is now.

The only thing I can think of is using the techniques in pacman demos to create a third canvas that is "zoomed in" which seems wastefully wrong?

if I should rather submit this as a fresh "how do I.." topic, let me know and I'll move it.
B
8
S
2
Posts: 32
Reputation: 620

### » Thu Nov 10, 2016 5:54 pm

You should make a new topic, and a capx.
Questions like "How do I then trim off the excess black area?" are hard to figure out without an example.
B
175
S
50
G
200
Posts: 8,628
Reputation: 124,532

PreviousNext