Algodoo portal 2
4 posts • Page 1 of 1
Algodoo portal 2
I'm personally thought it's impossible... but, few test, and wow! It works!
Interesting code here:
The rest is in the boxes and circles, there are 3 copy of each.
Interesting code here:
- Code: Select all
// Portals positions and angles
Scene.my.portalPos := [[[0, -3], 1.5707964], [[-3, 0], 0]];
// Transform pos, vel, angle of object through portal 0 or 1 (blue or orange)
Scene.my.teleTrans := (pos, vel, angle, tele)=>{
da := (scene.my.portalPos(1 - tele)(1) - scene.my.portalPos(tele)(1));
[scene.my.portalPos(1 - tele)(0) + scene.my.rot(pos - scene.my.portalPos(tele)(0), da)] ++ [scene.my.rot(vel, da)] ++ [angle - da]
};
// Rotate vector
Scene.my.rot := (v, a)=>{cos_a := math.cos(a); sin_a := math.sin(a); [v(0) * cos_a + v(1) * sin_a, v(1) * cos_a - v(0) * sin_a]};
The rest is in the boxes and circles, there are 3 copy of each.
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Algodoo portal 2
Very nice. Is is possible to make one that works with all objects? even new ones that have no code?
Human horse pasture expansion OpenGL Book Hall
Kwon owned Version (C) 2002-2008
-
guyboy - Posts: 80
- Joined: Mon Aug 31, 2009 6:19 pm
- Location: Ḻ̘̬͕͍͚̥͈͚͖̝̜̲͕̭̩ͅ
Re: Algodoo portal 2
Everything possible =) but not in that scene.
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Algodoo portal 2
Decided to make a follow-up to this.
- BlockJuice
- Posts: 4
- Joined: Mon Jul 22, 2013 1:49 am
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests