[Effect] mode7

Share your Construct 2 effect files

Post » Fri Mar 04, 2016 10:53 pm

So for the past couple days I've been working with a friend to try and implement the "sprite positioning logic" from the capx earlier in this thread so that it still works when the mode7 transformation is being applied to a layer instead of a sprite; doing this opens up a lot of possibilities for visual effects without the performance overhead of hundreds of sprites with individual mode7 effects, but figuring out how the projection math/logic changes as a result of this has been difficult. Our layout is always the size of our window (i.e. no scrolling) and the angle is always zero, so this helped us to simplify stuff, but even now that we've refactored the sprite positioning logic down to a couple of lines it's still hard to figure out what we need to change make sprites map properly. I haven't been able to figure out things like where the axis of rotation is when we're using a layer instead of a sprite. I've made the most logical substitutions I can think of for the code you provided, like replacing Sprite.Width with LayoutWidth, but I don't have 100% confidence that all these conversions are valid. Any insight you can offer on how the original sprite positioning math works and how it would change in this context would be much appreciated. I can provide a capx of our work so far, but we've moved so far away from the original code while trying to fix it that it might not be much help.
B
11
S
2
Posts: 35
Reputation: 868

Post » Sun Mar 06, 2016 8:19 pm

@seven
The original code in that capx is from taking the code in the effect itself and reversing it. The only snag was in the effect the positions are relative to either the screen or object, in the range of 0 to 1. So 0,0 would be the top left and 1,1 would be the bottom right. So as I recall multiplying by the sprite size was to switch between that and pixels.
Beyond that I don't have anything helpful to say. If I was to do it I'd probably need to derive the math again so I understand what's what. But I've no time to do that.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Tue Mar 08, 2016 12:49 pm

With this awesome mode7 effect by R0J0hound I was able to re-size the notes and the fret board/track and another effect called Opacity Gradient I created a transparent horizon (end of the board) and also notes fade in/out as well, so with all this you can add a background and it looks like the real game..
controls:
~ = restart game
ESC = pause/rewind
1 = green
2 = red
3 = yellow
4 = blue
5 = orange
ARROW KEYS UP/DOWN = strum (hit notes)

Play the unfinished prototype here: https://googledrive.com/host/0B5UPPw4SdTlHMUlORE5qQ1YyTWs

Image
B
4
Posts: 6
Reputation: 218

Post » Sat Jul 23, 2016 9:37 pm

Has anyone implemented mode 7 successfully? I've tried the effect in combination with rex's plugins but the image distorts a lot and i don't seem to get the parameters right. Help!
Image
Image
Image
B
15
S
2
Posts: 48
Reputation: 1,595

Post » Mon Aug 08, 2016 3:02 am

Awesome! thanks!
B
49
S
17
G
5
Posts: 69
Reputation: 5,881

Post » Thu Aug 11, 2016 9:45 pm

I'm trying to figure out how to spawn objects in front of the camera. They all seem to appear in the exact same place if i use the co-ordinates of the camera. Any ideas?
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Fri Nov 18, 2016 10:39 pm

Just had the bright idea of sorting instances in R0j0's mode7fx_objs capx with the new system z sort.
Image
Wanted to use the scale to sort, but we don't have an expression for it so I used the difference in height since scale should always be uniform to width.

Works nice.
Really need the formula for the camera to fx offset to do much else with it though.
The math is crazy. It's not just backwards, it's backwards, and sideways. lol
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Previous

Return to Effects

Who is online

Users browsing this forum: No registered users and 0 guests