Hi,

For OpenGL stuff, I partially ported an OpenGL library for VisualWorks
called "Jun" to Pharo.
The Pharo version is available at https://github.com/tomooda/Jun .

The 3D pic that Richard posted looks like a simple polygon with a 3D image
as a texture.
The following code does something like that.

        | square form rc projection morph |
        square := Jun3dDisplayPolygon
                points:
                        (Array
                                with: -1 ,, 0 ,, -1
                                with: 1 ,, 0 ,, -1
                                with: 1 ,, 0 ,, 1
                                with: -1 ,, 0 ,, 1).
        square
                setTexture: (JunTexture on: JunSystem logo)
                points:
                        (Array
                                with: 0 ,, 1
                                with: 1 ,, 1
                                with: 1 ,, 0
                                with: 0 ,, 0).
        projection := JunPerspectiveProjection
                eyePoint: 2,, -2 ,, 2
                sightPoint: 0 ,, 0 ,, 0
                upVector: 0 ,, 0 ,, 1
                fovy: 60 asDegrees
                near: 0.1
                far: 100.0.
        form := Form extent: 500 @ 500 depth: 32.
        rc := form renderingContext.
        rc backgroundColor: (Color white alpha: 0.0).
        rc projection: projection.
        rc clear.
        rc ambientLight: Color gray.
        rc lightIndex: 0 parallel: projection eyePoint negated color: Color 
gray.
        square renderOn: rc.
        rc flush.
        form asMorph openInWindow

Best Regards,
---
tomo




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply via email to