Perspective Transform (was: Screen shots for Squeak.org)

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Mon Jun 21 13:00:26 UTC 1999


On Mon, 21 Jun 1999, Christian Brunschen wrote:

> On Mon, 21 Jun 1999, Bert Freudenberg wrote:
> 
> > On 20 Jun 1999, Lawson English wrote:
> > 
> > > Bert Freudenberg <bert at isgnw.CS.Uni-Magdeburg.De> said:
> > > > And why would we want to have perspective distortion if we do not
> > > > go three-dimensional?
> > > 
> > >       Long, long ago
> > > In a galaxy far, far away...
> > 
> > That doesn't answer my question ...
> 
> Lawson refers to the effect used in the introductions to various Star Wars
> movies, where text scrolls upwards/away. 

I did get that joke, but still I'm not convinced this would be useful
except for a cool Squeak intro ;-)

It actually was a serious question. If we knew what it should be used 
for, it would make the discussion less speculatory.

> [ snip ]
> 
> > > And doesn't work right for text and vectors. How do you hit-test a
> > > selection of text if there's been a texture-mapping warp applied to it?
> > 
> > Project the mouse coordinates back into de-warped space and do hit
> > detection as usual. 
> 
> In fact, this has nothing at all to do with texture-mapping as such - just
> coordinate space transformations; the same inverse coordinate
> transformation would have to be performed even if vectors were passed from
> the 2d drawing engine directly to the 3d drawing engine.

That's exactly my point - hit detection or interaction in general is no
argument pro or against the analytic or discretized approach. Well, speed
does matter ... 

> > For the UI, I insist that the texture-mapping approach would work.
> 
> Texture mapping is a very simple, well-known way to get the result of
> 2-dimensional drawing, onto a three-dimensional surface. So, yes, of
> course it would work. And it could, nay, _should_ be layered, so that the
> 2d engine is never aware that it lives in a warped 3d world, and that the
> 3d layer does all the coordinate transforms, and the texture mapping, 
> invisibly to the 2d graphics layer below.

Yep, that's how it should be, and that is, what I wanted to suggest, but
couldn't say in your clear words.

> Perhaps what is really needed for cases like that is an OpenGL printer :)

That would be fun, indeed :-)  And if it runs fast enough, say, at 12
pages per second, we get paper animation! 

A propos Star Wars scroller. How about this one:

	| warp src dest |
	warp _ (WarpBlt toForm: Display)
		cellSize: 1;
		sourceForm: Display;
		cellSize: 2;
		combinationRule: Form over.
	src _ {-200 at -100. -50 at 100. 50 at 100. 200 at -100}.
	dest _ 0 at 0 corner: 200 at 100.
	Display restoreAfter: [
		[Sensor anyButtonPressed] whileFalse:
			[warp copyQuad: src + Sensor cursorPoint
				toRect: dest]]

Have fun,
/bert

-- 
 Bert Freudenberg                                       Department of 
                                                        Simulation and
                                                        Computer Graphics
 http://isgwww.cs.uni-magdeburg.de/isg/bert.html        Univ. of Magdeburg





More information about the Squeak-dev mailing list