Difference between revisions of "Wavelengths"

From The Powder Toy
Jump to: navigation, search
(Better table formatting still)
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
To set a wavelength, you need to set the ctype to get different wavelength.
 
To set a wavelength, you need to set the ctype to get different wavelength.
 
The wavelengths are:
 
The wavelengths are:
  (Wave Number) .  (Ctype)
 
  
  Blue wavelengths Rightmost
+
[[File:Wavelengths.png|frame]]
    |
+
 
    |
+
{| class="wikitable static-row-numbers" style="text-align:right"
    V
+
|+ Wavelength values (from blue to red)
  1.1
+
|-
  2.2
+
! !!Decimal value!!Hexadecimal value
  3.4
+
|-
  4.8
+
!1
  5.16
+
|1||0x1
  6.32
+
|-
  7.64
+
!2
  8.128
+
|2||0x2
  9.256
+
|-
  10.512
+
!3
  11.1024
+
|4||0x4
  12.2048
+
|-
  13.4096
+
!4
  14.8192
+
|8||0x8
  15.16384
+
|-
  16.32768
+
!5
  17.65536
+
|16||0x10
  18.131072
+
|-
  19.262144
+
!6
  20.524288
+
|32||0x20
  21.1048576
+
|-
  22.2097152
+
!7
  23.4194304
+
|64||0x40
  24.8388608
+
|-
  25.16777216
+
!8
  26.33554432
+
|128||0x80
  27.67108864
+
|-
  28.134217728
+
!9
  29.268435456
+
|256||0x100
  30.536870912
+
|-
   
+
!10
    ^
+
|512||0x200
    |
+
|-
    |
+
!11
  Red Wavelengths Leftmost
+
|1024||0x400
[[File:Wavelengths.gif|frame]]
+
|-
 +
!12
 +
|2048||0x800
 +
|-
 +
!13
 +
|4096||0x1000
 +
|-
 +
!14
 +
|8192||0x2000
 +
|-
 +
!15
 +
|16384||0x4000
 +
|-
 +
!16
 +
|32768||0x8000
 +
|-
 +
!17
 +
|65536||0x10000
 +
|-
 +
!18
 +
|131072||0x20000
 +
|-
 +
!19
 +
|262144||0x40000
 +
|-
 +
!20
 +
|524288||0x80000
 +
|-
 +
!21
 +
|1048576||0x100000
 +
|-
 +
!22
 +
|2097152||0x200000
 +
|-
 +
!23
 +
|4194304||0x400000
 +
|-
 +
!24
 +
|8388608||0x800000
 +
|-
 +
!25
 +
|16777216||0x1000000
 +
|-
 +
!26
 +
|33554432||0x2000000
 +
|-
 +
!27
 +
|67108864||0x4000000
 +
|-
 +
!28
 +
|134217728||0x8000000
 +
|-
 +
!29
 +
|268435456||0x10000000
 +
|-
 +
!30
 +
|536870912||0x20000000
 +
|}
  
 
You can add them together, e.g. to get both wavelengths, 30 (the leftmost and the reddest wavelength) and 1 (the rightmost and the bluest wavelength) in the same spectra, you need to add the corresponding ctypes in the chart.  
 
You can add them together, e.g. to get both wavelengths, 30 (the leftmost and the reddest wavelength) and 1 (the rightmost and the bluest wavelength) in the same spectra, you need to add the corresponding ctypes in the chart.  
Line 51: Line 107:
 
1.1 ctype for wave 1 = 1,
 
1.1 ctype for wave 1 = 1,
 
536870912 + 1 = 536870913. So, set the ctype of the PHOT or FILT or whatever to 536870913 to get both wavelengths 30 and 1.
 
536870912 + 1 = 536870913. So, set the ctype of the PHOT or FILT or whatever to 536870913 to get both wavelengths 30 and 1.
 +
 +
If you know hexadecimal working with ctypes becomes very easy because every hexadecimal digit represents a cluster of 4 wavelengths. Assume we want to set the second, the fourth, the fifth and the eight wavelength:
 +
wavelength 2 = 0x2, wavelength 4 = 0x8, wavelength 5 = 0x10 and wavelength 8 = 0x80, adding them gives 0x2 + 0x8 + 0x10 + 0x80 = 0x9a.
 +
  You can enter hexadecimal values in the console and in the PROP tool by using the 0x prefix.

Latest revision as of 15:03, 8 October 2023

Wavelengths are stored in the ctype field and determine the colour of the elements (e.g. PHOT, FILT, BRAY, BIZR, BIZS and BIZG.) They can be used as storage by setting the wavelengths to a certain amount and read that info by filtering out some wavelengths and letting others through. This save shows that use. Wavelengths are displayed at the HUD on top of the element name. In a full spectrum, the wavelengths on the left are red, and on the right they are blue. In between are the colours of the rainbow. When it isn't a full spectrum, then some colours will be missing. To set a wavelength, you need to set the ctype to get different wavelength. The wavelengths are:

Wavelengths.png
Wavelength values (from blue to red)
Decimal value Hexadecimal value
1 1 0x1
2 2 0x2
3 4 0x4
4 8 0x8
5 16 0x10
6 32 0x20
7 64 0x40
8 128 0x80
9 256 0x100
10 512 0x200
11 1024 0x400
12 2048 0x800
13 4096 0x1000
14 8192 0x2000
15 16384 0x4000
16 32768 0x8000
17 65536 0x10000
18 131072 0x20000
19 262144 0x40000
20 524288 0x80000
21 1048576 0x100000
22 2097152 0x200000
23 4194304 0x400000
24 8388608 0x800000
25 16777216 0x1000000
26 33554432 0x2000000
27 67108864 0x4000000
28 134217728 0x8000000
29 268435456 0x10000000
30 536870912 0x20000000

You can add them together, e.g. to get both wavelengths, 30 (the leftmost and the reddest wavelength) and 1 (the rightmost and the bluest wavelength) in the same spectra, you need to add the corresponding ctypes in the chart. 30.536870912 ctype for wave 30 = 536870912, 1.1 ctype for wave 1 = 1, 536870912 + 1 = 536870913. So, set the ctype of the PHOT or FILT or whatever to 536870913 to get both wavelengths 30 and 1.

If you know hexadecimal working with ctypes becomes very easy because every hexadecimal digit represents a cluster of 4 wavelengths. Assume we want to set the second, the fourth, the fifth and the eight wavelength: wavelength 2 = 0x2, wavelength 4 = 0x8, wavelength 5 = 0x10 and wavelength 8 = 0x80, adding them gives 0x2 + 0x8 + 0x10 + 0x80 = 0x9a.

 You can enter hexadecimal values in the console and in the PROP tool by using the 0x prefix.