home *** CD-ROM | disk | FTP | other *** search
- Since the 1980's, several films have been screened that feature
- 3D vision. The effect can be quite fantastic - depending on the
- technique used. Probably the most well known method is using the
- red/green glasses, but this does have the disadvantage that
- colour cannot be used. Another technique is using polarised
- light. This requires two projectors which polarise the beams of
- light differently (90° 'apart'). The glasses then block out one
- of the beams by having polarised lenses. This is debatably the
- most effective method, allowing full colour.
- Another form of three dimensional vision is to have a single
- screen that flickers between the display for the left and right
- eyes. The glasses are then synchronised to do the same. The Sega
- system uses this form, but it suffers from a very flickery image.
- Because the average user does not have access to polarised light
- projectors or 'flickery' glasses, the first method is a good
- choice to demonstrate the 3D effect.
-
- The first thing we must understand before we venture into the
- world of 3D is how the eye perceives 'depth'. Our eyes,
- surprisingly enough, move independently. They move so as to focus
- in on an object.
- When an object is close to 'infinity' (as far away as possible)
- our eyes are near parallel, that is point directly ahead and each
- eyes' line of sight converges a long distance away. When our eyes
- point near parallel, our brain assumes the object to be a long
- way away.
- When an object is near, the eyes swing towards into other,
- converging at a closer point. This can be seen when somebody
- tries to look at their nose. If the eyes point inwards, our brain
- believes the object to be close.
-
- Now, how do we convert that theory onto the screen? Well, under
- normal circumstances, each eyes' line of sight converges at the
- screen. If an object is to be seen behind the monitor (further
- away), we must instruct each eye to swing outwards, towards the
- parallel. This can be expressed as : the left eye's image must be
- further to the left, and the right eye's image must be further to
- the right. From this, we should realise that the image passed to
- the left eye should be on the left, and the image for the right
- eye, on the right. Therefore, we can expect forward projections
- (in front of the monitor) to have the right eye's image at the
- left, and the left image at the right. This will make the lines
- of sight converge before the screen.
-
- Note however, that the distance between the left and right images
- should not exceed the distance between each eye, otherwise the 3D
- effect is lost. Indeed, due to the inability to exactly match the
- colour of the glasses, a separation of about 32 OS units is all
- we can expect.
-
- Now is where the glasses come in - separating the left eye's
- image and the right eye's. The lenses in each eye are a different
- colour - normally red and green, or red and blue. The glasses I
- used were red in the left eye and blue in the right. The same
- glasses could possibly be obtained from your local cinema, as
- they were used for the film, "Freddy's Dead". Anyway, one lens
- will totally block out the colour of the other. Therefore, by
- making the left image the colour of the left lens, and the right
- image the colour of the right lens, it is possible to separate
- the picture on the screen.
-
- Probably the hardest part of creating a 3D image is finding the
- exact colour of each lens. The simplest way of doing this is to
- run listing one (found on the free subscription disc). It will
- initially draw a red circle in the centre of the screen. Place a
- lens over it and alter the colour (which is displayed as three
- figures at the top of the screen) by using the keys as described.
- When the circle appears as dark as possible in one lens, but is
- still bright in the other, note down the colour numbers (and
- which lens it was visible in) and repeat with the other lens. You
- may find all this easier in a dark room.
-
- An example of the sort of effect that can be achieved with the
- information described here can be seen with listing two - a three
- dimensional star field. Close all the curtains and doors - the 3D
- effect can best be seen in total darkness - and run the program.
-
- If you own a television, you will notice a poor effect, if any.
- The only way to avoid this is to use a good quality PAL encoder,
- or use a monitor. The better the quality of the monitor, the more
- amazing the effect. If you can see 'ghosting', that is seeing
- both red and blue (or whatever colours the lenses are) lines, try
- moving away from the screen more - on a good multisync, it is
- possible to sit normally at the computer and still see a clear
- picture.
-
- If you find stars a little boring, take a look at listing three.
- This is the source code to create the module '3DPlotMod'. This
- module provides one SWI that can be accessed from BASIC, or most
- other languages. This function allows 3D vector graphics to be
- produced, by passing the x,y and z coordinates. The appropriate
- red and blue shapes will be drawn. To use it from BASIC, for
- example, you should enter :
-
- SYS "3D_Plot",plot action,x,y,z
-
- x,y and z are the coordinates of the line, arc or whatever you
- wish to draw. The plot action parameter is the same as for VDU25
- (Plot). For those of you without PRM, here's a summary of the
- codes :
-
- All codes can be expressed as "<base> + <action>". the Base
- number tells the computer what shap you wish to draw. Action
- tells the computer how you want to draw it. The base values are
- as follows :
-
- 0 - draw a line, or move to the point
- 64 - plot a point
- 80 - draw a filled triangle
- 96 - draw a filled rectangle
- 112 - draw a filled parallelogram
- 144 - draw a circle outline
- 152 - draw a filled circle
- 160 - draw an arc
- 168 - draw a segment
- 176 - draw a sector
- 192 - draw an ellipse outline
- 200 - draw a filled ellipse
-
- The action values that should be added to the above bases are as
- follows :
-
- 0 - move relative to the last position visited (MOVE BY)
- 1 - draw relative to the last position visited
- 4 - move to the given position
- 5 - draw at the given position
-
- Codes 0 and 1 can be illustrated : If the last point you moved
- (or drew) to was 400,600 and you issued a move by (value 0)
- 100,-200 the new position would be 500,400.
-
- As an example, let us draw a line from 300,676,375 to 274,607,374
- What you must do is :
- Move to one end ...
- SYS "3D_Plot",4,300,676,375
- And then draw a line to the other ...
- SYS "3D_Plot",5,274,607,374
-
- To draw a more complex shape, such as a triangle, move to the two
- corners and issue a 85 (ie. 80 + 5) for the final corner.
-
- Listing four is a final summary of the ideas described here. It
- contains the start-field from listing two, and adds a spinning
- pyramid bouncing backwards and forwards.
- The pyramid is drawn in machine code for speed, and uses the
- 3DPlotMod for the vector graphics. Note that to run this program,
- you must have the Module 3DLines loaded - this can be achieved by
- double-clicking on the 3DPlotMod icon in the desktop.
-
- The application !3DSetup is a simple program that defines the
- colours used for the left and right lenses. This can be used to
- adjust the colours to suit you - everyones eyes' see light and
- colour differently. Run the application as normal by double-
- clicking on its icon. Then, to change the left lens colour, press
- 'L', or 'R' to change the right one.
- Then, follow the instructions on the screen. When you exit from
- the program (not by pressing Escape), the settings you have
- changed will be saved to disc. Note that this will not work if
- you are running !3DSetUp from an archive, ie. follow the
- instructions in the magazine on how to unpack the archive.
- From now on, all the programs will use these settings for their
- colours.
-
- Many thanks to Vincent Sanders and the local cinema for their
- tremendous support for this project and their help with the
- research into 3D techniques.
-
-