Learning B3D (newbie)

aldel at alum.mit.edu aldel at alum.mit.edu
Wed Aug 2 16:12:18 UTC 2000


I've been trying to figure out how to do 3D rendering (and
simultaneously learning Smalltalk and Squeak, but I'm doing OK with
those).  The examples in the Balloon3D-Demo Morphs category make some
sense, but when I try to do my own rendering, I get nothing.  In
particular, the following code typed in a workspace just makes a black
square (from the clearViewport message):

rend _ B3DRenderEngine defaultForPlatformOn: Display.
rend viewport: (Rectangle origin: 10 at 10 extent: 200 at 200).
rend clearViewport: Color black.
cam _ B3DCamera new.
cam initialize.
cam position: 0 at 0@2.
rend clearDepthBuffer.
rend loadIdentity.
cam renderOn: rend.
"tex _ Form fromUser.
rend texture: tex."
"rend trackEmissionColor: true."
rend normal: 0 at 0@1.
rend color: Color white.
rend drawPolygonAfter: [
	rend
		"texCoords: -1 at -1;"
		vertex: -1 at -1@0;
		"texCoords:1 at -1;"
		vertex: 1 at -1@0;
		"texCoords: 1 at 1;"
		vertex: 1 at 1@0;
		"texCoords: -1 at 1;"
		vertex: -1 at 1@0.
	].

The lines that are commented out are things that I tried but didn't
help.  Can anyone explain what I need to to differently?

Once I've got that figured out, obviously I'll be wanting to do more.
Is there any documentation outside of the code?  Barring that, an
example that's more interesting than an unshaded rotating cube but
less complicated than Alice would be useful.

A couple specific questions:

Is there an easy way to make it render wireframes?  (Something like
OpenGL's glPolygonMode(GL_FRONT,GL_LINE))

A way to cull back-facing polygons? (Like glCullFace(GL_BACK))

What's the status of the hardware rendering plugin?  Will code I write
now have to be changed to take advantage of it?


Alan deLespinasse





More information about the Squeak-dev mailing list