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

Lawson English english at primenet.com
Sun Jun 20 20:25:43 UTC 1999


Bert Freudenberg <bert at isgnw.CS.Uni-Magdeburg.De> said:

>On 19 Jun 1999, Lawson English wrote:
>
>> One thing missing from all the current graphics engines is the ability
to
>> apply perspective. 
>

I meant "from all the current *2D* graphics engines..."

>I'm not really sure what you mean by this - almost every 3D graphics
>engine has this ability: it's called texture mapping. 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...



The ability to apply 3D perspective to bitmaps is trivial. WarpBlit does
this using a quadralateral warp.

HOWEVER, the abilityt to apply it to vectors, especially text, and then
edit the same AFTER the perspective has been applied, is not trivial.
Printing the text as device-independent vectors is also not trivial. You
need the kind of solution that I described above.


>> I have a rough idea how to do it*, but I'm not sure how useable it would
>> be in Squeak without creating C-primitives that support it. 
>> 
>> However, it if IS doable, it would certainly make Squeak more powerful
>> than anything else out there. 
>
>It's already there!  Almost, that is. Balloon3D is able to display a
>bitmap (Form)  with perspective.  So you could have it display a window's
>form as easily as a loaded bitmap.  What's missing is the ability to make
>this view respond to mouse/key events in the same way as it does in the
>2D-World.  Just imagine some arbitrary Morph being dropped into a
>Wonderland and living there happily on ...
>

Yar, but you need the ability to handle bezier-based text...

>> *cache the line-segments of a bezier path as it would be drawn without
>> perspective, and then apply the perspective to each line segment. This
>> strategy works well, but probably requires efficient (C-based) access to
>> the cached info in order to run in real-time. 
>
>IMHO this would be too specific, the texture mapping approach is more
>general.
>

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?

The only graphics engine that does this is GX and that is going away on the
Mac and was never implemented elsewhere.


There's several pieces missing from the Squeak graphics libraries in order
to make your 3D morph work right:

3D perspective for vectors & text. 3D perspective for views. Hit-testing
methods for 2D graphics & text that work with 3D perspective.
Text-selection methods that work with 3D perspective. Etc.

In order to print these properly to PS printers, you also need to have a
translator that can grab the original vector/text info, apply the 3D warp
to it and translate THAT to PS.

All of the above is very complex and it took Apple 7 years and a LOT of
manhours to get right, and I'm not even suggesting that we should work to
add these capabilities to Squeak.

However, I *am* pointing out that the "Pure SmallTalk" approach to porting
Squeak has certain limitations and that unless some simpler way is created
to add and port externals than currently exists, the "pure SmallTalk"
limitation is going to become more and more evident.


----------------------------------------------------------------------
Use your imagination...
----------------------------------------------------------------------





More information about the Squeak-dev mailing list