Coronation demo

Here you can link to screenshots and demos etc. of programs made using BBC BASIC
Hated Moron

Coronation demo

Post by Hated Moron »

This is John Ireland's Epic March which was played at the Coronation of Queen Elizabeth II in 1953 (transcribed for computer by Gerald Pye on 31st October 1981). It is accompanied by a 3D model of St Edward's Crown, animated in BBC BASIC for SDL 2.0. You can run it yourself in a suitable browser (although it's a large model and slow to load) here.

https://www.youtube.com/watch?v=cAsmbs1UPrM
Hated Moron

Re: Coronation demo

Post by Hated Moron »

The usual reason for splitting the 3D 'world' into multiple objects is, of course, so that they can be moved independently. That doesn't apply in this case, but the crown has still been split into four objects because it comprises different materials, which have very different optical properties.

In the video below I have separated the four objects for clarity:
  • The gold, which has a specular reflection that, unusually, isn't white.
  • The velvet, which reflects mostly diffuse, although directional, light.
  • The ermine, which largely reflects ambient, non-directional, light.
  • The jewels, which have a white specular component with a high 'power'.
Each has a corresponding material{} structure in the code, allowing the various parameters to be adjusted for best results.

https://www.youtube.com/watch?v=1IfLEXlE4Gw
Hated Moron

Re: Coronation demo

Post by Hated Moron »

Hated Moron wrote: Sat 06 May 2023, 16:29 The gold, which has a specular reflection that, unusually, isn't white.
I thought I understood specular reflection (I specialised in optics for my physics degree, although that was more than 50 years ago) but now I'm not so sure.

My understanding was that specular reflection from a dielectric material (insulator) would always be 'white', i.e. the colour of the illuminating light, whereas specular reflection from a conductor (e.g. a metal) would have the colour of the material.

So specular reflection from copper or gold would be coloured, whereas specular reflection from a gemstone such as ruby or emerald would be white. But look what it says in this table of colours:

Code: Select all

Name	Ambient RGB		Diffuse RGB		Specular RGB		Shininess
emerald	0.0215	0.1745	0.0215	0.07568	0.61424	0.07568	0.633	0.72781	0.633	0.6
ruby	0.1745	0.01175	0.01175	0.61424	0.04136	0.04136	0.72781	0.62695	0.62695	0.6
copper	0.19125	0.0735	0.0225	0.7038	0.27048	0.0828	0.25677	0.13762	0.08601	0.1
gold	0.24725	0.1995	0.0745	0.75164	0.60648	0.22648	0.62828	0.55580	0.36606	0.4
There the specular reflection from emerald is shown as slightly green and that from ruby as slightly red. Is this actually correct, and if so why?