This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-09-02 10:19:07

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Help needed - complex geometry

I've used a thoughts and discoveries from Jens and Myredneptune to create a new scrollign system that has the map rotate under the sprite - good for a racing or flying game.

Check out this helicopter, controlled with the arrow keys, flying over a rather sparse map.

http://scratch.mit.edu/projects/Mayhem/33629

The map rotates but it rotates around its current x/y position.  I need help with the geometry to make it appear as though the map's centre of rotation is actually under the helicopter.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#2 2007-09-02 11:01:23

aleagui
Scratcher
Registered: 2007-06-18
Posts: 8

Re: Help needed - complex geometry

But you will have to change the rotation centre while the game is runing!


There are 10 kinds of people... the ones who count in binary and the ones who don´t.

Offline

 

#3 2007-09-02 12:13:55

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Help needed - complex geometry

Hence the need for gemetry, to calculate how the individual map sections should be moved to simulate their rotational origin being under the helicopter.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#4 2007-09-02 13:32:48

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Help needed - complex geometry

What you need are "transformation matrices".  These are sometimes taught in linear algebra classes, and almost always taught in computer graphics and computer vision classes (generally sophomore or junior level college classes, though the math is really no harder than trigonometry).

Offline

 

Board footer