Selaa lähdekoodia

Initial commit

Andreas Völker 5 vuotta sitten
commit
86e729fdec

+ 14 - 0
BlochRender.iml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="com.io7m.bundles:org.jogamp.jogl:2.3.2001" level="project" />
+    <orderEntry type="library" name="com.miglayout:miglayout-swing:4.2" level="project" />
+    <orderEntry type="library" name="jogamp-fat" level="project" />
+  </component>
+</module>

BIN
colormap.png


+ 800 - 0
exampledata.txt

@@ -0,0 +1,800 @@
+0 1 0 0
+0.125 1 -9.75037e-06 0.000233765
+0.25 0.999999 -7.76378e-05 0.000927764
+0.375 0.999996 -0.000259982 0.00206028
+0.5 0.999987 -0.000609512 0.00359566
+0.625 0.999969 -0.00117367 0.00548517
+0.75 0.999937 -0.00199304 0.0076681
+0.875 0.999889 -0.00309996 0.0100732
+1 0.99982 -0.00451728 0.0126204
+1.125 0.999729 -0.00625737 0.0152227
+1.25 0.999614 -0.00832143 0.0177882
+1.375 0.999476 -0.010699 0.0202226
+1.5 0.999318 -0.0133677 0.0224311
+1.625 0.999142 -0.0162935 0.0243214
+1.75 0.998955 -0.0194311 0.0258056
+1.875 0.998764 -0.0227246 0.0268025
+2 0.998574 -0.0261084 0.0272401
+2.125 0.998395 -0.0295087 0.0270574
+2.25 0.998231 -0.0328449 0.026206
+2.375 0.99809 -0.0360309 0.0246523
+2.5 0.997976 -0.0389779 0.0223777
+2.625 0.99789 -0.0415952 0.0193804
+2.75 0.997832 -0.0437934 0.0156756
+2.875 0.997799 -0.045486 0.0112958
+3 0.997785 -0.0465913 0.00629061
+3.125 0.997782 -0.0470353 0.00072648
+3.25 0.997781 -0.046753 -0.00531438
+3.375 0.99777 -0.0456909 -0.011735
+3.5 0.997736 -0.043808 -0.0184253
+3.625 0.997669 -0.0410783 -0.0252638
+3.75 0.997557 -0.0374913 -0.0321198
+3.875 0.997391 -0.0330534 -0.0388557
+4 0.997165 -0.0277883 -0.0453298
+4.125 0.996876 -0.0217378 -0.0513989
+4.25 0.996524 -0.0149614 -0.0569215
+4.375 0.996114 -0.00753595 -0.0617604
+4.5 0.995653 0.000444819 -0.065786
+4.625 0.995153 0.00887169 -0.0688792
+4.75 0.994629 0.0176213 -0.0709342
+4.875 0.994096 0.0265582 -0.071861
+5 0.993571 0.0355366 -0.0715877
+5.125 0.993072 0.0444029 -0.0700626
+5.25 0.992613 0.0529988 -0.0672561
+5.375 0.992209 0.0611633 -0.0631615
+5.5 0.991869 0.0687362 -0.0577959
+5.625 0.991598 0.075561 -0.0512008
+5.75 0.991399 0.0814879 -0.0434421
+5.875 0.991265 0.0863767 -0.0346091
+6 0.991189 0.0901 -0.0248141
+6.125 0.991156 0.0925457 -0.0141907
+6.25 0.991149 0.0936196 -0.00289238
+6.375 0.991147 0.0932478 0.00891009
+6.5 0.991129 0.0913788 0.0210308
+6.625 0.991072 0.087985 0.0332718
+6.75 0.990955 0.0830644 0.045426
+6.875 0.99076 0.076641 0.0572807
+7 0.990472 0.0687656 0.0686215
+7.125 0.990081 0.0595159 0.0792354
+7.25 0.989585 0.0489957 0.0889158
+7.375 0.988985 0.0373341 0.0974652
+7.5 0.988291 0.0246842 0.1047
+7.625 0.987518 0.0112208 0.110454
+7.75 0.986685 -0.0028616 0.114583
+7.875 0.985817 -0.017352 0.116964
+8 0.98494 -0.0320258 0.117504
+8.125 0.984083 -0.0466484 0.116138
+8.25 0.983271 -0.0609793 0.112832
+8.375 0.982529 -0.0747755 0.107586
+8.5 0.981877 -0.0877962 0.100432
+8.625 0.981329 -0.0998067 0.091436
+8.75 0.980894 -0.110583 0.0806968
+8.875 0.980572 -0.119914 0.0683456
+9 0.980355 -0.127608 0.0545436
+9.125 0.980229 -0.133497 0.0394807
+9.25 0.980172 -0.137435 0.0233724
+9.375 0.980158 -0.139306 0.00645729
+9.5 0.980157 -0.139026 -0.011007
+9.625 0.980135 -0.136543 -0.0287473
+9.75 0.98006 -0.13184 -0.0464789
+9.875 0.979903 -0.124936 -0.0639103
+10 0.979635 -0.115887 -0.0807477
+10.125 0.979238 -0.104786 -0.0966999
+10.25 0.978698 -0.0917609 -0.111484
+10.375 0.978009 -0.0769751 -0.124828
+10.5 0.977177 -0.0606245 -0.13648
+10.625 0.976214 -0.0429353 -0.146208
+10.75 0.975141 -0.0241612 -0.153809
+10.875 0.973987 -0.00457903 -0.159109
+11 0.972784 0.0155145 -0.161972
+11.125 0.97157 0.0358081 -0.162296
+11.25 0.970382 0.0559801 -0.160021
+11.375 0.969258 0.0757043 -0.15513
+11.5 0.968231 0.0946547 -0.147649
+11.625 0.967327 0.112511 -0.137646
+11.75 0.966567 0.128966 -0.125232
+11.875 0.96596 0.143725 -0.110562
+12 0.965508 0.15652 -0.0938279
+12.125 0.9652 0.167106 -0.0752611
+12.25 0.965018 0.17527 -0.0551258
+12.375 0.964932 0.180834 -0.0337166
+12.5 0.964909 0.183659 -0.0113545
+12.625 0.964907 0.183647 0.0116186
+12.75 0.964884 0.180744 0.0348444
+12.875 0.964798 0.174941 0.0579537
+13 0.964608 0.166276 0.0805724
+13.125 0.96428 0.154834 0.102327
+13.25 0.963787 0.140746 0.122852
+13.375 0.963112 0.124187 0.141793
+13.5 0.962248 0.105377 0.158816
+13.625 0.9612 0.084576 0.173612
+13.75 0.959985 0.0620789 0.185903
+13.875 0.958629 0.0382148 0.195446
+14 0.957167 0.0133402 0.202041
+14.125 0.955642 -0.012166 0.20553
+14.25 0.9541 -0.0379084 0.205806
+14.375 0.95259 -0.0634812 0.202811
+14.5 0.951158 -0.0884747 0.196541
+14.625 0.949847 -0.112482 0.187044
+14.75 0.94869 -0.135106 0.174424
+14.875 0.947713 -0.155964 0.158834
+15 0.94693 -0.174699 0.140478
+15.125 0.946341 -0.190979 0.11961
+15.25 0.945936 -0.204509 0.0965248
+15.375 0.945691 -0.215032 0.0715582
+15.5 0.945572 -0.222335 0.0450807
+15.625 0.945536 -0.226255 0.0174919
+15.75 0.945533 -0.22668 -0.010785
+15.875 0.945512 -0.223549 -0.0393099
+16 0.945418 -0.216861 -0.067632
+16.125 0.945204 -0.206668 -0.0952973
+16.25 0.944826 -0.193082 -0.121855
+16.375 0.944252 -0.176269 -0.146866
+16.5 0.943458 -0.156448 -0.169908
+16.625 0.942437 -0.13389 -0.190586
+16.75 0.941193 -0.108915 -0.208534
+16.875 0.939745 -0.0818844 -0.223427
+17 0.938123 -0.0531976 -0.234985
+17.125 0.936372 -0.0232868 -0.242977
+17.25 0.93454 0.00739054 -0.247226
+17.375 0.932684 0.0383587 -0.247615
+17.5 0.930862 0.069131 -0.244088
+17.625 0.92913 0.0992177 -0.23665
+17.75 0.927539 0.128134 -0.225372
+17.875 0.92613 0.155406 -0.210386
+18 0.924935 0.180583 -0.191884
+18.125 0.923972 0.203241 -0.17012
+18.25 0.923243 0.22299 -0.1454
+18.375 0.922735 0.239483 -0.118082
+18.5 0.922422 0.252419 -0.088568
+18.625 0.922265 0.261552 -0.0573004
+18.75 0.922212 0.266691 -0.0247534
+18.875 0.922208 0.267708 0.00857263
+19 0.922188 0.264537 0.0421596
+19.125 0.922092 0.257179 0.0754789
+19.25 0.921862 0.2457 0.108
+19.375 0.921445 0.230234 0.139198
+19.5 0.920803 0.210977 0.168562
+19.625 0.919908 0.18819 0.195606
+19.75 0.918748 0.162191 0.219873
+19.875 0.917328 0.133355 0.240944
+20 0.915667 0.102104 0.258448
+20.125 0.913802 0.0689051 0.272065
+20.25 0.911781 0.0342607 0.281536
+20.375 0.909661 -0.00129781 0.286663
+20.5 0.907508 -0.0372187 0.287319
+20.625 0.905388 -0.0729387 0.283445
+20.75 0.903366 -0.107892 0.275055
+20.875 0.901502 -0.141518 0.262238
+21 0.899847 -0.173273 0.245151
+21.125 0.898436 -0.202637 0.224025
+21.25 0.897291 -0.229123 0.199154
+21.375 0.896417 -0.252285 0.170897
+21.5 0.895802 -0.271724 0.139666
+21.625 0.895417 -0.287097 0.105929
+21.75 0.895217 -0.298122 0.0701918
+21.875 0.895145 -0.304584 0.0330006
+22 0.895136 -0.306336 -0.0050727
+22.125 0.89512 -0.303304 -0.0434363
+22.25 0.895026 -0.29549 -0.0814881
+22.375 0.894786 -0.28297 -0.118625
+22.5 0.894342 -0.265896 -0.154252
+22.625 0.893646 -0.244494 -0.187792
+22.75 0.892665 -0.219058 -0.218695
+22.875 0.891386 -0.189952 -0.246445
+23 0.889811 -0.157598 -0.270574
+23.125 0.887962 -0.122477 -0.290663
+23.25 0.885876 -0.0851154 -0.306357
+23.375 0.883608 -0.0460826 -0.317366
+23.5 0.881222 -0.00597829 -0.323472
+23.625 0.87879 0.0345751 -0.324534
+23.75 0.876389 0.0749424 -0.320492
+23.875 0.874092 0.114486 -0.311365
+24 0.871967 0.152576 -0.297256
+24.125 0.870071 0.1886 -0.278348
+24.25 0.868448 0.221974 -0.2549
+24.375 0.867123 0.25215 -0.227247
+24.5 0.866104 0.278627 -0.195793
+24.625 0.865379 0.300959 -0.161003
+24.75 0.864917 0.31876 -0.1234
+24.875 0.864669 0.331715 -0.0835543
+25 0.864574 0.339581 -0.0420744
+25.125 0.86456 0.342193 0.000399957
+25.25 0.864548 0.339467 0.043209
+25.375 0.864458 0.331404 0.0856822
+25.5 0.864216 0.318088 0.127149
+25.625 0.863753 0.299687 0.166948
+25.75 0.863016 0.276447 0.20444
+25.875 0.861968 0.248698 0.239015
+26 0.86059 0.216839 0.270103
+26.125 0.858883 0.181339 0.297185
+26.25 0.856868 0.142729 0.319802
+26.375 0.854587 0.101591 0.33756
+26.5 0.852097 0.0585546 0.350141
+26.625 0.849469 0.0142818 0.357306
+26.75 0.846782 -0.0305396 0.358901
+26.875 0.844119 -0.0752084 0.35486
+27 0.841564 -0.119021 0.345208
+27.125 0.839191 -0.161281 0.330058
+27.25 0.837065 -0.201314 0.309612
+27.375 0.835236 -0.238475 0.284158
+27.5 0.833735 -0.272161 0.254066
+27.625 0.832571 -0.301817 0.219779
+27.75 0.831734 -0.326952 0.18181
+27.875 0.831192 -0.34714 0.140732
+28 0.830894 -0.362031 0.0971726
+28.125 0.830773 -0.371357 0.051798
+28.25 0.830751 -0.374934 0.00530922
+28.375 0.830742 -0.372668 -0.0415716
+28.5 0.830659 -0.364556 -0.0881114
+28.625 0.830419 -0.350685 -0.133577
+28.75 0.829948 -0.331236 -0.177248
+28.875 0.829184 -0.306477 -0.218425
+29 0.828085 -0.276762 -0.256443
+29.125 0.826628 -0.242524 -0.290683
+29.25 0.824811 -0.204272 -0.320579
+29.375 0.822656 -0.162581 -0.34563
+29.5 0.820206 -0.118084 -0.365409
+29.625 0.817521 -0.0714631 -0.37957
+29.75 0.814677 -0.023437 -0.387852
+29.875 0.81176 0.0252478 -0.390088
+30 0.808859 0.0738299 -0.386206
+30.125 0.806065 0.121545 -0.376232
+30.25 0.803461 0.167639 -0.360289
+30.375 0.801119 0.211378 -0.338595
+30.5 0.799094 0.252061 -0.311461
+30.625 0.797422 0.289033 -0.279285
+30.75 0.796116 0.321692 -0.242547
+30.875 0.795167 0.349503 -0.201802
+31 0.794543 0.372001 -0.157668
+31.125 0.794191 0.388807 -0.11082
+31.25 0.794041 0.399623 -0.0619787
+31.375 0.794008 0.40425 -0.011899
+31.5 0.794002 0.402579 0.0386412
+31.625 0.793928 0.394603 0.0888522
+31.75 0.793696 0.380412 0.137945
+31.875 0.793225 0.360196 0.185144
+32 0.792446 0.334237 0.229698
+32.125 0.791312 0.302911 0.270892
+32.25 0.789795 0.266682 0.308058
+32.375 0.787892 0.22609 0.34059
+32.5 0.785623 0.18175 0.367949
+32.625 0.783032 0.134337 0.389675
+32.75 0.780181 0.0845814 0.405395
+32.875 0.777149 0.0332509 0.414829
+33 0.774029 -0.0188561 0.417795
+33.125 0.770915 -0.070925 0.414215
+33.25 0.767906 -0.122138 0.404115
+33.375 0.765091 -0.171687 0.387621
+33.5 0.762548 -0.218787 0.364967
+33.625 0.760339 -0.262686 0.336481
+33.75 0.758504 -0.302681 0.302588
+33.875 0.757061 -0.338129 0.263797
+34 0.756002 -0.368451 0.220696
+34.125 0.755295 -0.39315 0.173946
+34.25 0.754887 -0.411815 0.124262
+34.375 0.754704 -0.424126 0.0724113
+34.5 0.754659 -0.429861 0.0191964
+34.625 0.754654 -0.428902 -0.0345559
+34.75 0.75459 -0.421235 -0.0880064
+34.875 0.75437 -0.406948 -0.140317
+35 0.753906 -0.386237 -0.190663
+35.125 0.753124 -0.359398 -0.238247
+35.25 0.751971 -0.326822 -0.282308
+35.375 0.750414 -0.288997 -0.322139
+35.5 0.748448 -0.246491 -0.357093
+35.625 0.746091 -0.199951 -0.386599
+35.75 0.743387 -0.150089 -0.410166
+35.875 0.740399 -0.0976733 -0.427397
+36 0.73721 -0.0435161 -0.437993
+36.125 0.733916 0.0115402 -0.441758
+36.25 0.730618 0.0666351 -0.438606
+36.375 0.727419 0.120904 -0.428559
+36.5 0.724415 0.173493 -0.41175
+36.625 0.72169 0.22357 -0.38842
+36.75 0.719312 0.27034 -0.358913
+36.875 0.717325 0.313059 -0.323673
+37 0.715751 0.351042 -0.283233
+37.125 0.714585 0.383676 -0.238214
+37.25 0.713796 0.410433 -0.189304
+37.375 0.71333 0.430872 -0.137258
+37.5 0.713113 0.44465 -0.0828805
+37.625 0.713052 0.45153 -0.027014
+37.75 0.713048 0.451378 0.0294728
+37.875 0.712994 0.444172 0.0856986
+38 0.71279 0.430001 0.140783
+38.125 0.712339 0.40906 0.19386
+38.25 0.711565 0.381655 0.24409
+38.375 0.710407 0.34819 0.290677
+38.5 0.70883 0.309168 0.332874
+38.625 0.706823 0.265182 0.370003
+38.75 0.704404 0.216904 0.401462
+38.875 0.701615 0.165075 0.426734
+39 0.698521 0.110496 0.445399
+39.125 0.695207 0.0540139 0.45714
+39.25 0.69177 -0.00349163 0.461749
+39.375 0.688318 -0.061122 0.45913
+39.5 0.684957 -0.117974 0.449303
+39.625 0.681788 -0.173153 0.432402
+39.75 0.678903 -0.225789 0.408672
+39.875 0.676372 -0.275051 0.37847
+40 0.674246 -0.320156 0.342255
+40.125 0.67255 -0.360387 0.300579
+40.25 0.671283 -0.3951 0.254083
+40.375 0.670414 -0.423737 0.203485
+40.5 0.66989 -0.445833 0.149567
+40.625 0.669636 -0.461025 0.0931646
+40.75 0.669558 -0.469057 0.0351529
+40.875 0.669552 -0.469784 -0.0235653
+41 0.669509 -0.463174 -0.0820742
+41.125 0.669322 -0.449312 -0.139459
+41.25 0.668891 -0.428394 -0.194818
+41.375 0.668134 -0.400728 -0.247281
+41.5 0.666985 -0.366729 -0.296016
+41.625 0.665405 -0.326912 -0.34025
+41.75 0.66338 -0.281884 -0.379273
+41.875 0.660925 -0.232337 -0.412459
+42 0.658081 -0.179035 -0.439269
+42.125 0.654912 -0.122804 -0.459262
+42.25 0.651504 -0.0645176 -0.472106
+42.375 0.647958 -0.0050847 -0.47758
+42.5 0.644382 0.0545658 -0.47558
+42.625 0.640888 0.113499 -0.466121
+42.75 0.637583 0.170791 -0.449335
+42.875 0.63456 0.225538 -0.425472
+43 0.631896 0.276879 -0.394894
+43.125 0.629647 0.324001 -0.358071
+43.25 0.62784 0.36616 -0.315569
+43.375 0.626478 0.402684 -0.268046
+43.5 0.625533 0.432993 -0.216238
+43.625 0.624952 0.456599 -0.160949
+43.75 0.62466 0.473121 -0.103038
+43.875 0.624562 0.482286 -0.0434056
+44 0.624553 0.483939 0.0170204
+44.125 0.62452 0.478038 0.0772972
+44.25 0.624352 0.46466 0.136483
+44.375 0.623946 0.444001 0.19365
+44.5 0.623214 0.416369 0.247902
+44.625 0.622087 0.382183 0.298381
+44.75 0.620521 0.341964 0.344289
+44.875 0.618499 0.296331 0.384897
+45 0.616033 0.245988 0.419555
+45.125 0.613162 0.191714 0.447705
+45.25 0.609949 0.134352 0.468893
+45.375 0.606481 0.0747956 0.482771
+45.5 0.602858 0.0139739 0.489106
+45.625 0.599192 -0.0471619 0.487788
+45.75 0.595598 -0.107654 0.478823
+45.875 0.592184 -0.166554 0.462344
+46 0.589049 -0.222937 0.438599
+46.125 0.586275 -0.275917 0.407954
+46.25 0.583919 -0.324658 0.370884
+46.375 0.582015 -0.368394 0.327963
+46.5 0.580566 -0.406433 0.27986
+46.625 0.57955 -0.438174 0.227323
+46.75 0.578914 -0.463113 0.17117
+46.875 0.578583 -0.480852 0.112277
+47 0.578465 -0.491106 0.0515592
+47.125 0.57845 -0.493705 -0.0100357
+47.25 0.578426 -0.4886 -0.0715472
+47.375 0.578278 -0.475862 -0.132015
+47.5 0.577901 -0.45568 -0.190493
+47.625 0.577201 -0.42836 -0.246065
+47.75 0.576107 -0.394321 -0.297857
+47.875 0.574571 -0.354087 -0.345053
+48 0.572573 -0.30828 -0.386906
+48.125 0.57012 -0.257611 -0.422753
+48.25 0.56725 -0.202867 -0.452021
+48.375 0.564024 -0.1449 -0.474241
+48.5 0.560528 -0.0846149 -0.489057
+48.625 0.556863 -0.0229543 -0.496225
+48.75 0.553141 0.0391176 -0.495627
+48.875 0.549478 0.100629 -0.487264
+49 0.545987 0.160615 -0.471262
+49.125 0.542768 0.218136 -0.44787
+49.25 0.539906 0.27229 -0.417452
+49.375 0.537464 0.322226 -0.380482
+49.5 0.535477 0.367161 -0.337541
+49.625 0.533953 0.40639 -0.289299
+49.75 0.532872 0.439297 -0.236512
+49.875 0.532184 0.465363 -0.180004
+50 0.531816 0.484179 -0.120657
+50.125 0.531675 0.495448 -0.0593988
+50.25 0.531654 0.498989 0.00281605
+50.375 0.531637 0.494744 0.0650166
+50.5 0.531509 0.482776 0.126232
+50.625 0.531162 0.463267 0.185505
+50.75 0.530502 0.436519 0.24191
+50.875 0.529451 0.402946 0.294562
+51 0.527959 0.36307 0.342635
+51.125 0.526003 0.31751 0.385372
+51.25 0.523587 0.266977 0.422098
+51.375 0.520745 0.21226 0.452234
+51.5 0.517537 0.154213 0.475301
+51.625 0.514046 0.0937449 0.490932
+51.75 0.510372 0.0318007 0.49888
+51.875 0.506629 -0.0306494 0.499016
+52 0.502931 -0.0926274 0.491337
+52.125 0.499394 -0.153163 0.475963
+52.25 0.49612 -0.211308 0.453138
+52.375 0.493196 -0.266152 0.423222
+52.5 0.490688 -0.316837 0.386688
+52.625 0.488636 -0.362572 0.344111
+52.75 0.487049 -0.402641 0.296163
+52.875 0.485911 -0.43642 0.243596
+53 0.485176 -0.463382 0.187236
+53.125 0.484772 -0.483108 0.127965
+53.25 0.484608 -0.495291 0.0667106
+53.375 0.484578 -0.499742 0.00442905
+53.5 0.484567 -0.496396 -0.0579073
+53.625 0.48446 -0.485304 -0.119326
+53.75 0.484145 -0.466642 -0.178867
+53.875 0.483528 -0.440704 -0.235602
+54 0.482529 -0.407896 -0.288645
+54.125 0.481095 -0.368732 -0.337164
+54.25 0.479198 -0.323825 -0.380401
+54.375 0.47684 -0.27388 -0.417676
+54.5 0.474052 -0.219679 -0.448406
+54.625 0.470891 -0.162071 -0.472108
+54.75 0.467437 -0.10196 -0.488409
+54.875 0.463789 -0.0402881 -0.497057
+55 0.460059 0.0219792 -0.497917
+55.125 0.456361 0.0838662 -0.490981
+55.25 0.452811 0.144404 -0.476362
+55.375 0.449512 0.202646 -0.454297
+55.5 0.446553 0.257683 -0.425139
+55.625 0.444003 0.308655 -0.389354
+55.75 0.441903 0.354769 -0.347511
+55.875 0.440268 0.395308 -0.300273
+56 0.439083 0.429643 -0.248387
+56.125 0.438306 0.457245 -0.192669
+56.25 0.437869 0.477687 -0.133995
+56.375 0.437682 0.490658 -0.0732855
+56.5 0.437642 0.495963 -0.0114893
+56.625 0.437635 0.493526 0.0504279
+56.75 0.437546 0.483391 0.1115
+56.875 0.437266 0.465726 0.170775
+57 0.436695 0.440811 0.227328
+57.125 0.435755 0.409044 0.280278
+57.25 0.43439 0.370926 0.328799
+57.375 0.432568 0.32706 0.372135
+57.5 0.430289 0.278137 0.40961
+57.625 0.427579 0.224926 0.44064
+57.75 0.424493 0.168266 0.464742
+57.875 0.421108 0.109045 0.481545
+58 0.417519 0.0481947 0.490789
+58.125 0.413836 -0.0133313 0.492339
+58.25 0.410172 -0.0745687 0.48618
+58.375 0.406642 -0.134559 0.472417
+58.5 0.403349 -0.192366 0.451281
+58.625 0.400384 -0.247086 0.423113
+58.75 0.397816 -0.29787 0.388371
+58.875 0.395689 -0.343928 0.34761
+59 0.394021 -0.384549 0.301481
+59.125 0.392801 -0.419105 0.250717
+59.25 0.391989 -0.447068 0.196122
+59.375 0.391522 -0.468012 0.138555
+59.5 0.391313 -0.481621 0.0789218
+59.625 0.391262 -0.487695 0.0181566
+59.75 0.391258 -0.486152 -0.0427904
+59.875 0.391186 -0.477029 -0.102968
+60 0.390939 -0.460481 -0.161439
+60.125 0.390418 -0.436779 -0.217293
+60.25 0.389543 -0.406304 -0.26966
+60.375 0.388255 -0.369543 -0.317728
+60.5 0.386522 -0.327082 -0.360749
+60.625 0.38434 -0.279594 -0.398058
+60.75 0.381732 -0.22783 -0.429076
+60.875 0.378747 -0.172607 -0.453326
+61 0.37546 -0.114796 -0.470438
+61.125 0.371963 -0.0553059 -0.480154
+61.25 0.368361 0.0049285 -0.482335
+61.375 0.364766 0.0649629 -0.476961
+61.5 0.361289 0.123858 -0.464132
+61.625 0.358035 0.180694 -0.444067
+61.75 0.355092 0.234587 -0.417098
+61.875 0.352531 0.284699 -0.383665
+62 0.350399 0.330256 -0.344311
+62.125 0.348715 0.370557 -0.299668
+62.25 0.347472 0.404983 -0.250448
+62.375 0.346635 0.433011 -0.197436
+62.5 0.346142 0.454218 -0.141469
+62.625 0.345913 0.468291 -0.0834292
+62.75 0.34585 0.475027 -0.0242285
+62.875 0.345846 0.474339 0.0352066
+63 0.345791 0.466254 0.0939484
+63.125 0.345576 0.450919 0.151082
+63.25 0.345106 0.428588 0.205718
+63.375 0.3443 0.399628 0.257011
+63.5 0.343098 0.364508 0.304164
+63.625 0.341466 0.32379 0.346449
+63.75 0.339397 0.278126 0.383213
+63.875 0.33691 0.228241 0.413894
+64 0.334052 0.174926 0.438021
+64.125 0.330892 0.119024 0.455232
+64.25 0.327517 0.0614168 0.465272
+64.375 0.324029 0.00301076 0.468001
+64.5 0.320536 -0.0552778 0.463397
+64.625 0.317147 -0.112537 0.451553
+64.75 0.313962 -0.167873 0.432676
+64.875 0.311071 -0.220426 0.407085
+65 0.308544 -0.269382 0.375204
+65.125 0.306429 -0.313986 0.337554
+65.25 0.304748 -0.353555 0.294746
+65.375 0.303497 -0.387487 0.247468
+65.5 0.302643 -0.415268 0.196476
+65.625 0.30213 -0.436485 0.142579
+65.75 0.301884 -0.450827 0.086631
+65.875 0.301809 -0.458093 0.0295111
+66 0.301805 -0.458193 -0.027885
+66.125 0.301763 -0.451148 -0.0846607
+66.25 0.30158 -0.437091 -0.139932
+66.375 0.30116 -0.416264 -0.19284
+66.5 0.300425 -0.389013 -0.242567
+66.625 0.299316 -0.355787 -0.288343
+66.75 0.297795 -0.317122 -0.329465
+66.875 0.295853 -0.273641 -0.365301
+67 0.293507 -0.22604 -0.395306
+67.125 0.290798 -0.175076 -0.419026
+67.25 0.287791 -0.12156 -0.436108
+67.375 0.284568 -0.0663363 -0.446305
+67.5 0.281226 -0.0102762 -0.44948
+67.625 0.277867 0.0457399 -0.445606
+67.75 0.274598 0.100835 -0.434771
+67.875 0.271515 0.154151 -0.417171
+68 0.268706 0.204859 -0.39311
+68.125 0.26624 0.252176 -0.362993
+68.25 0.264166 0.295375 -0.327316
+68.375 0.262507 0.333797 -0.286664
+68.5 0.261261 0.366861 -0.241695
+68.625 0.260402 0.394071 -0.193133
+68.75 0.259877 0.415027 -0.141752
+68.875 0.259616 0.429426 -0.0883676
+69 0.259531 0.43707 -0.0338222
+69.125 0.259524 0.437869 0.0210275
+69.25 0.259493 0.431837 0.0753243
+69.375 0.259339 0.419096 0.128223
+69.5 0.25897 0.399873 0.178902
+69.625 0.258309 0.374496 0.22658
+69.75 0.257295 0.343384 0.270521
+69.875 0.255894 0.307049 0.310053
+70 0.254091 0.26608 0.344573
+70.125 0.251902 0.221137 0.373559
+70.25 0.249363 0.172939 0.396577
+70.375 0.246533 0.122255 0.413289
+70.5 0.243489 0.0698894 0.423459
+70.625 0.240322 0.0166687 0.426954
+70.75 0.23713 -0.0365697 0.423747
+70.875 0.234011 -0.0889921 0.413921
+71 0.231062 -0.139782 0.39766
+71.125 0.228364 -0.188151 0.375251
+71.25 0.225987 -0.233354 0.347077
+71.375 0.223977 -0.274699 0.31361
+71.5 0.22236 -0.311559 0.275404
+71.625 0.221137 -0.343379 0.233081
+71.75 0.220284 -0.369686 0.187326
+71.875 0.219755 -0.390098 0.138875
+72 0.219483 -0.404325 0.0884987
+72.125 0.219389 -0.412176 0.0369947
+72.25 0.219379 -0.41356 -0.0148266
+72.375 0.219358 -0.40849 -0.0661541
+72.5 0.219231 -0.397076 -0.116189
+72.625 0.218911 -0.379529 -0.164155
+72.75 0.218322 -0.356154 -0.209313
+72.875 0.217408 -0.327346 -0.25097
+73 0.216131 -0.293584 -0.288491
+73.125 0.214478 -0.25542 -0.321307
+73.25 0.21246 -0.213474 -0.348926
+73.375 0.210108 -0.168422 -0.37094
+73.5 0.207477 -0.120986 -0.38703
+73.625 0.204637 -0.0719205 -0.396974
+73.75 0.201673 -0.0220036 -0.400646
+73.875 0.198676 0.0279785 -0.398022
+74 0.19574 0.0772426 -0.389178
+74.125 0.192954 0.125021 -0.374289
+74.25 0.190397 0.170574 -0.353625
+74.375 0.188135 0.213201 -0.327545
+74.5 0.186215 0.252253 -0.296491
+74.625 0.184661 0.287139 -0.260984
+74.75 0.183477 0.317338 -0.221608
+74.875 0.182644 0.342406 -0.179006
+75 0.182119 0.361983 -0.133864
+75.125 0.181842 0.375797 -0.0869063
+75.25 0.18174 0.383665 -0.0388785
+75.375 0.181727 0.385503 0.00946173
+75.5 0.181713 0.381318 0.0573568
+75.625 0.181611 0.371214 0.104061
+75.75 0.181336 0.355383 0.14885
+75.875 0.18082 0.33411 0.191036
+76 0.180006 0.307759 0.229974
+76.125 0.178859 0.276776 0.265072
+76.25 0.177363 0.241673 0.295803
+76.375 0.175526 0.203027 0.321709
+76.5 0.173377 0.161463 0.342413
+76.625 0.170963 0.117652 0.357621
+76.75 0.168351 0.0722955 0.367127
+76.875 0.165615 0.0261132 0.370817
+77 0.162842 -0.0201653 0.36867
+77.125 0.160117 -0.0658141 0.36076
+77.25 0.157523 -0.110122 0.34725
+77.375 0.155135 -0.152404 0.328392
+77.5 0.153015 -0.192011 0.304522
+77.625 0.151208 -0.228342 0.276051
+77.75 0.149739 -0.260852 0.243461
+77.875 0.148612 -0.289059 0.207297
+78 0.147812 -0.312552 0.168151
+78.125 0.147301 -0.330999 0.126662
+78.25 0.147025 -0.344147 0.0834961
+78.375 0.146918 -0.351831 0.0393436
+78.5 0.146902 -0.353971 -0.00509724
+78.625 0.146894 -0.350574 -0.0491287
+78.75 0.146812 -0.341735 -0.0920644
+78.875 0.146581 -0.327631 -0.13324
+79 0.146135 -0.308524 -0.172024
+79.125 0.145421 -0.28475 -0.207825
+79.25 0.144405 -0.256715 -0.240103
+79.375 0.143071 -0.224891 -0.268376
+79.5 0.141425 -0.189805 -0.292229
+79.625 0.139491 -0.152032 -0.311319
+79.75 0.137312 -0.112185 -0.32538
+79.875 0.134946 -0.0709047 -0.334227
+80 0.132462 -0.0288498 -0.337762
+80.125 0.129937 0.0133138 -0.33597
+80.25 0.127449 0.0549236 -0.328921
+80.375 0.125075 0.0953314 -0.31677
+80.5 0.122884 0.133913 -0.299751
+80.625 0.120932 0.170079 -0.278174
+80.75 0.119262 0.203282 -0.252419
+80.875 0.117899 0.233028 -0.222928
+81 0.116847 0.258879 -0.190199
+81.125 0.116094 0.280465 -0.154776
+81.25 0.115608 0.297485 -0.11724
+81.375 0.115341 0.309713 -0.0781999
+81.5 0.115232 0.316999 -0.0382821
+81.625 0.115213 0.319273 0.00187927
+81.75 0.115209 0.316545 0.0416521
+81.875 0.115146 0.308902 0.080416
+82 0.114955 0.296508 0.117572
+82.125 0.114575 0.2796 0.15255
+82.25 0.113959 0.258483 0.184821
+82.375 0.113074 0.233528 0.2139
+82.5 0.111906 0.205159 0.239359
+82.625 0.110457 0.173854 0.260827
+82.75 0.108748 0.140131 0.278002
+82.875 0.106817 0.104543 0.29065
+83 0.104714 0.0676642 0.298614
+83.125 0.102501 0.0300878 0.30181
+83.25 0.100247 -0.00758931 0.300233
+83.375 0.0980209 -0.0447742 0.293953
+83.5 0.0958925 -0.0808875 0.283115
+83.625 0.0939231 -0.115372 0.267938
+83.75 0.0921647 -0.147703 0.248705
+83.875 0.0906556 -0.177394 0.225762
+84 0.0894189 -0.204006 0.199512
+84.125 0.0884606 -0.227153 0.170403
+84.25 0.0877698 -0.246508 0.138925
+84.375 0.0873192 -0.261807 0.105602
+84.5 0.0870677 -0.272854 0.0709769
+84.625 0.086962 -0.27952 0.0356102
+84.75 0.0869412 -0.281749 6.63917e-05
+84.875 0.0869399 -0.279553 -0.0350933
+85 0.0868924 -0.273015 -0.0693196
+85.125 0.0867373 -0.262284 -0.102084
+85.25 0.0864207 -0.247575 -0.132886
+85.375 0.0858996 -0.229164 -0.16126
+85.5 0.0851449 -0.207379 -0.186786
+85.625 0.0841424 -0.182601 -0.209091
+85.75 0.0828939 -0.155254 -0.227857
+85.875 0.0814171 -0.125795 -0.242825
+86 0.0797437 -0.0947141 -0.253799
+86.125 0.077918 -0.0625177 -0.26065
+86.25 0.0759934 -0.0297262 -0.263315
+86.375 0.0740294 0.00313679 -0.2618
+86.5 0.0720876 0.0355526 -0.256178
+86.625 0.0702277 0.0670157 -0.246586
+86.75 0.0685041 0.097042 -0.233225
+86.875 0.0669623 0.125176 -0.216355
+87 0.0656365 0.150997 -0.196286
+87.125 0.0645471 0.174129 -0.173378
+87.25 0.0637001 0.19424 -0.148031
+87.375 0.0630866 0.211053 -0.120679
+87.5 0.0626838 0.224345 -0.0917805
+87.625 0.0624562 0.233954 -0.0618147
+87.75 0.0623584 0.239775 -0.0312697
+87.875 0.0623379 0.241767 -0.000636384
+88 0.0623385 0.239951 0.0295992
+88.125 0.0623037 0.234404 0.058964
+88.25 0.0621804 0.225265 0.0870045
+88.375 0.0619222 0.212726 0.113294
+88.5 0.0614918 0.197031 0.137439
+88.625 0.060864 0.17847 0.159085
+88.75 0.0600261 0.157377 0.17792
+88.875 0.0589795 0.134118 0.193683
+89 0.0577387 0.109093 0.206164
+89.125 0.0563306 0.0827205 0.215209
+89.25 0.0547926 0.0554379 0.220719
+89.375 0.0531699 0.0276896 0.222657
+89.5 0.0515129 -7.8259e-05 0.221041
+89.625 0.0498737 -0.0274258 0.215949
+89.75 0.048303 -0.0539262 0.207513
+89.875 0.0468467 -0.0791724 0.195918
+90 0.0455434 -0.102784 0.181397
+90.125 0.0444219 -0.124411 0.164227
+90.25 0.0434997 -0.143743 0.144725
+90.375 0.0427818 -0.16051 0.12324
+90.5 0.0422608 -0.174486 0.100147
+90.625 0.0419177 -0.185496 0.075841
+90.75 0.0417229 -0.193413 0.0507303
+90.875 0.0416386 -0.198162 0.0252292
+91 0.0416209 -0.199721 -0.000248516
+91.125 0.0416232 -0.198118 -0.0252961
+91.25 0.0415984 -0.193431 -0.0495205
+91.375 0.0415028 -0.185788 -0.0725478
+91.5 0.0412978 -0.175359 -0.0940294
+91.625 0.0409529 -0.162358 -0.113647
+91.75 0.0404473 -0.147037 -0.131116
+91.875 0.0397709 -0.129679 -0.146194
+92 0.0389249 -0.110597 -0.158676
+92.125 0.0379215 -0.0901246 -0.168407
+92.25 0.0367829 -0.0686141 -0.175277
+92.375 0.0355398 -0.0464272 -0.179224
+92.5 0.0342294 -0.0239304 -0.180236
+92.625 0.0328926 -0.00148898 -0.178349
+92.75 0.0315718 0.0205395 -0.173647
+92.875 0.030308 0.0418107 -0.166257
+93 0.0291381 0.0619988 -0.15635
+93.125 0.0280931 0.0808019 -0.144135
+93.25 0.0271956 0.0979465 -0.129856
+93.375 0.0264592 0.113191 -0.113785
+93.5 0.0258875 0.12633 -0.0962186
+93.625 0.025474 0.137197 -0.0774737
+93.75 0.0252029 0.145663 -0.0578788
+93.875 0.0250503 0.151645 -0.0377701
+94 0.0249855 0.155098 -0.0174852
+94.125 0.0249738 0.156023 0.00264198
+94.25 0.0249779 0.154458 0.0222871
+94.375 0.024961 0.150484 0.0411403
+94.5 0.0248888 0.144218 0.0589108
+94.625 0.0247316 0.135813 0.0753316
+94.75 0.0244661 0.125452 0.0901632
+94.875 0.0240768 0.113347 0.103197
+95 0.0235567 0.0997346 0.114258
+95.125 0.0229078 0.0848704 0.123207
+95.25 0.0221404 0.0690249 0.129945
+95.375 0.0212725 0.0524789 0.13441
+95.5 0.0203284 0.0355182 0.136578
+95.625 0.0193371 0.0184293 0.136468
+95.75 0.0183304 0.00149387 0.134135
+95.875 0.0173405 -0.0150156 0.12967
+96 0.0163983 -0.0308401 0.1232
+96.125 0.0155313 -0.0457386 0.114883
+96.25 0.0147618 -0.0594915 0.104903
+96.375 0.0141061 -0.0719038 0.0934717
+96.5 0.013573 -0.0828084 0.0808177
+96.625 0.0131637 -0.0920675 0.0671864
+96.75 0.0128722 -0.0995749 0.0528334
+96.875 0.0126854 -0.105257 0.0380204
+97 0.0125845 -0.109072 0.0230103
+97.125 0.012546 -0.111012 0.00806254
+97.25 0.0125439 -0.111101 -0.0065711
+97.375 0.0125506 -0.109392 -0.0206508
+97.5 0.0125397 -0.10597 -0.0339525
+97.625 0.0124869 -0.100945 -0.0462714
+97.75 0.0123717 -0.0944511 -0.0574247
+97.875 0.0121787 -0.0866441 -0.067255
+98 0.0118987 -0.0776979 -0.0756315
+98.125 0.0115283 -0.067801 -0.0824524
+98.25 0.0110708 -0.0571527 -0.087646
+98.375 0.0105354 -0.0459591 -0.091171
+98.5 0.00993631 -0.0344299 -0.093017
+98.625 0.00929194 -0.022774 -0.0932038
+98.75 0.0086234 -0.0111961 -0.0917806
+98.875 0.00795305 0.000107218 -0.0888245
+99 0.00730306 0.0109504 -0.0844382
+99.125 0.00669389 0.0211624 -0.0787479
+99.25 0.00614308 0.0305892 -0.0719002
+99.375 0.00566412 0.039096 -0.0640589
+99.5 0.00526576 0.0465698 -0.0554011
+99.625 0.00495159 0.0529201 -0.0461144
+99.75 0.00471998 0.0580803 -0.036392
+99.875 0.00456437 0.0620081 -0.0264296

+ 3 - 0
out/production/BlochRender/META-INF/MANIFEST.MF

@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: de.andreasvoelker.Main
+

+ 68 - 0
src/de/andreasvoelker/BlochFrame.java

@@ -0,0 +1,68 @@
+package de.andreasvoelker;
+
+import com.jogamp.opengl.GLCapabilities;
+import com.jogamp.opengl.GLCapabilitiesImmutable;
+import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import java.awt.event.*;
+
+public class BlochFrame extends GLCanvas {
+    BlochRenderer renderer;
+    Animator animator;
+
+
+    class MyMouseMotionListener implements MouseMotionListener {
+        int prevX, prevY;
+
+        @Override
+        public void mouseDragged(MouseEvent e) {
+            int dx = e.getX()-prevX;
+            int dy = e.getY()-prevY;
+
+            renderer.setPitch(renderer.getPitch()+0.01f*dx);
+            renderer.setYaw(renderer.getYaw()+0.01f*dy);
+
+            prevX = e.getX();
+            prevY = e.getY();
+        }
+
+        @Override
+        public void mouseMoved(MouseEvent e) {
+            prevX = e.getX();
+            prevY = e.getY();
+
+        }
+    }
+
+    class MyMouseWheelListener implements MouseWheelListener {
+
+        @Override
+        public void mouseWheelMoved(MouseWheelEvent e) {
+            System.out.println("Executed");
+            System.out.println(e.getWheelRotation());
+            renderer.setRadius(renderer.getRadius()+0.1f*(float)e.getWheelRotation());
+        }
+    }
+
+    BlochFrame(){
+        super(getCapabilities());
+        renderer = new BlochRenderer();
+        addGLEventListener(renderer);
+        setSize(400, 400);
+        animator = new Animator(this);
+        animator.start();
+        addMouseMotionListener(this.new MyMouseMotionListener());
+        addMouseWheelListener(this.new MyMouseWheelListener());
+    }
+
+    private static GLCapabilitiesImmutable getCapabilities() {
+        final GLProfile profile = GLProfile.get(GLProfile.GL2);
+        return new GLCapabilities(profile);
+    }
+
+    public void setBlochSphere(BlochSphere blochSphere) {
+        renderer.setBlochSphere(blochSphere);
+    }
+}

+ 120 - 0
src/de/andreasvoelker/BlochRenderer.java

@@ -0,0 +1,120 @@
+package de.andreasvoelker;
+
+import com.jogamp.opengl.GL2;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLEventListener;
+import com.jogamp.opengl.glu.GLU;
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureIO;
+
+import java.io.File;
+import java.io.IOException;
+
+public class BlochRenderer implements GLEventListener {
+
+    private BlochSphere blochSphere;
+    private GLU glu = new GLU();
+    Texture colormap;
+
+    private float radius = 3;
+    private float pitch = 0;
+    private float yaw = 0;
+
+    public float getRadius() {
+        return radius;
+    }
+
+    public void setRadius(float radius) {
+        if (radius < 0) radius = 0;
+        this.radius = radius;
+    }
+
+    public float getPitch() {
+
+        return pitch;
+    }
+
+    public void setPitch(float pitch) {
+        while(pitch > 2*Math.PI) pitch -= (float)2*Math.PI;
+        while(pitch < 0) pitch += (float)2*Math.PI;
+        this.pitch = pitch;
+    }
+
+    public float getYaw() {
+        return yaw;
+    }
+
+    public void setYaw(float yaw) {
+        if (yaw > 0.4*Math.PI) yaw = (float) (0.4*Math.PI);
+        if (yaw < -0.4*Math.PI) yaw = (float) (-0.4*Math.PI);
+        this.yaw = yaw;
+    }
+
+    @Override
+    public void init(GLAutoDrawable drawable) {
+        try {
+            colormap = TextureIO.newTexture(new File("colormap.png"), false);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void dispose(GLAutoDrawable drawable) {
+
+    }
+
+
+    @Override
+    public void display(GLAutoDrawable drawable) {
+
+        final GL2 gl = drawable.getGL().getGL2();
+        setupViewMatrix(gl);
+        gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
+        gl.glEnable(gl.GL_DEPTH_TEST);
+        if (blochSphere != null) {
+            if (colormap != null){
+                colormap.enable(gl);
+                colormap.bind(gl);
+            }
+
+            float t0 = blochSphere.minTime();
+            float t1 = blochSphere.maxTime();
+            float factor = 1/(t1-t0); // convert time to texture coordinate
+
+            gl.glBegin(GL2.GL_LINE_STRIP);
+            for (int i = 0; i != blochSphere.getSize(); i++) {
+                gl.glVertex3f(blochSphere.pre[i], blochSphere.pim[i], blochSphere.f[i]);
+                gl.glTexCoord1f((factor*blochSphere.t[i]-t0));
+            }
+            gl.glEnd();
+        }
+
+    }
+
+    private void setupViewMatrix(GL2 gl) {
+        gl.glMatrixMode( GL2.GL_MODELVIEW );
+        gl.glLoadIdentity();
+        glu.gluLookAt(radius*Math.sin(pitch)*Math.cos(yaw), radius*Math.cos(pitch)*Math.cos(yaw), radius*Math.sin(yaw), 0,0 ,0, 0, 0,  1);
+    }
+
+    @Override
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        GL2 gl = drawable.getGL().getGL2();
+        if( height <=0 )
+            height =1;
+        final float h = ( float ) width / ( float ) height;
+        gl.glViewport( 0, 0, width, height );
+        gl.glMatrixMode( GL2.GL_PROJECTION );
+        gl.glLoadIdentity();
+        glu.gluPerspective( 45.0f, h, 1.0, 20.0 );
+        setupViewMatrix(gl);
+
+
+    }
+
+    public void setBlochSphere(BlochSphere blochSphere) {
+        this.blochSphere = blochSphere;
+    }
+
+}

+ 60 - 0
src/de/andreasvoelker/BlochSphere.java

@@ -0,0 +1,60 @@
+package de.andreasvoelker;
+
+import java.util.ArrayList;
+
+public class BlochSphere {
+    private static final int INITIAL_RESERVED = 20;
+    private static final float GOLDEN_RATIO = 1.618f;
+    public float [] t = new float[INITIAL_RESERVED];
+    public float [] f = new float[INITIAL_RESERVED];
+    public float [] pre = new float[INITIAL_RESERVED];
+    public float [] pim = new float[INITIAL_RESERVED];
+
+    private int size=0;
+    private int reserved = INITIAL_RESERVED;
+
+    public void add(float t0, float f0, float pre0, float pim0){
+        if (size+1 > reserved){
+            grow();
+        }
+        t[size] = t0;
+        // convert to gl coordinates on sphere
+        f[size] = -(2*f0-1);
+        pre[size] = 2*pre0;
+        pim[size] = 2*pim0;
+        size++;
+    }
+
+    private void grow() {
+
+        reserved = (int)(GOLDEN_RATIO*reserved);
+
+        float [] tmp = new float[reserved];
+        System.arraycopy(t, 0, tmp, 0, size);
+        t = tmp;
+
+        tmp = new float[reserved];
+        System.arraycopy(f, 0, tmp, 0, size);
+        f = tmp;
+
+        tmp = new float[reserved];
+        System.arraycopy(pre, 0, tmp, 0, size);
+        pre = tmp;
+
+        tmp = new float[reserved];
+        System.arraycopy(pim, 0, tmp, 0, size);
+        pim = tmp;
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    public float minTime() {
+        return t[0];
+    }
+
+    public float maxTime() {
+        return t[size-1];
+    }
+}

+ 11 - 0
src/de/andreasvoelker/Main.java

@@ -0,0 +1,11 @@
+package de.andreasvoelker;
+
+import javax.swing.*;
+
+public class Main {
+
+    public static void main(String[] args) {
+        MainWindows mw = new MainWindows();
+        mw.setVisible(true);
+    }
+}

+ 71 - 0
src/de/andreasvoelker/MainWindows.java

@@ -0,0 +1,71 @@
+package de.andreasvoelker;
+
+import com.jogamp.opengl.GLCapabilities;
+import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+import net.miginfocom.swing.MigLayout;
+
+import javax.swing.*;
+import java.io.*;
+import java.util.Locale;
+import java.util.Scanner;
+
+public class MainWindows extends JFrame {
+    JButton button;
+    BlochFrame blochFrame;
+
+    MainWindows(){
+        super("BlochRender");
+        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+        blochFrame = new BlochFrame();
+
+        button = new JButton("Select File");
+        button.addActionListener(e -> chooseFile());
+
+        setLayout(new MigLayout("fill"));
+
+        add(blochFrame, "grow, span 1 2");
+        add(button, "wrap");
+        this.pack();
+
+    }
+
+    private void chooseFile() {
+        JFileChooser fileChooser = new JFileChooser();
+        fileChooser.setCurrentDirectory(new File("."));
+        int ret = fileChooser.showOpenDialog(this);
+        if (ret == JFileChooser.APPROVE_OPTION){
+            loadFile(fileChooser.getSelectedFile());
+        }
+    }
+
+    private void loadFile(File selectedFile) {
+        FileInputStream fileInputStream;
+        try {
+            fileInputStream = new FileInputStream(selectedFile);
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+            return;
+        }
+        BlochSphere blochSphere = new BlochSphere();
+        BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));
+        String line;
+        try {
+            while ((line = reader.readLine()) != null){
+                String[] split = line.split(" ");
+                blochSphere.add(Float.parseFloat(split[0]),
+                        Float.parseFloat(split[1]),
+                        Float.parseFloat(split[2]),
+                        Float.parseFloat(split[3]));
+
+            }
+        }
+        catch (IOException io){
+            io.printStackTrace();
+            return;
+        }
+        blochFrame.setBlochSphere(blochSphere);
+    }
+}