[GOODIE] Texture-mapped spheres

Dan Ingalls Dan.Ingalls at disney.com
Fri Feb 4 19:16:16 UTC 2000


Folks -

Andreas couldn't stop last night and left a present for us this am.

Ted and I hacked  a bit on the Project loading method, which we have added at the end of this message (it will also appear shortly as an update).

If you fileIn this method, you can then download Andreas's "Squeak - the Final Frontier" from Squeak.org, ungzip it, and open it in a project, all with the following simple do-it...

	Project thumbnailFromUrl:
	'http://www.squeak.org/Squeak2.0/FinalFrontier.morph.gz'.

Thanks to Duane Maxwell for getting this all started, and for the great textures.
Thanks to Andreas for the magic.
And thanks to Ted for guiding me through HTTP file transfers.

Enjoy
	- Dan

---------------------------
!Project class methodsFor: 'utilities' stamp: 'di 2/4/2000 10:44'!
thumbnailFromUrl: urlString
	"Load the project, and make a thumbnail to it in the current project."

	| aFileStream morphOrList proj thumbnail | 
	aFileStream _ (urlString asLowercase endsWith: '.gz')
		ifTrue: [(RWBinaryOrTextStream with:
			(GZipReadStream on: (ServerFile new fullPath: urlString) asStream)
						upToEnd)
					reset]
		ifFalse: [(ServerFile new fullPath: urlString) asStream].
	morphOrList _ aFileStream fileInObjectAndCode.
	(morphOrList isKindOf: ImageSegment) ifTrue: [
		proj _ morphOrList arrayOfRoots detect: [:mm | mm class == Project] 
					ifNone: [nil].
		"rename the project if it conflicts?"
		proj ifNotNil: [
			thumbnail _ (SystemWindow labelled: proj name) model: proj.
			thumbnail addMorph: (ProjectViewMorph on: proj)
				frame: (0 at 0 corner: 1.0 at 1.0).
			thumbnail openInWorld]].

	(morphOrList isKindOf: PasteUpMorph) ifFalse: [
		^ self inform: 'This is not a PasteUpMorph or exported Project.'].
	(thumbnail _ ProjectViewMorph newMorphicProjectOn: morphOrList) openInWorld.
	thumbnail model enter
! !






More information about the Squeak-dev mailing list