2012-05-15Three.js and Stella-like polyhedronsWith a framework like Three.js, it is pretty easy to display the faces of simple polyhedrons using WebGL. But a polyhedron, considered less as a physical and more as a topological object, consists not only of its faces. Instead often its vertices and edges are equaly interesting, and it would be nice to have an easy way to display them, perhaps assigning them different colors, to distinguish different kinds of vertices or different kinds of edges. Within the program Stella, vertices can be displayed as small balls and edges as thin tubes, and I wrote a function to be used in conjunction with Three.js which makes it a bit easier to construct similar graphical objects, following a similar visual style, within WebGL. In the following examples, I’ll assume that we have set up all the usual Three.js stuff with renderers and virtual cameras and mouse controls and lights and that we have defined a Scene-object. Furthermore, I’ll assume that we imported my helper file JAN3D.js which contains the function JAN3D.stella() (among other stuff; I also included JAN3D.TinyTrackballControls). I’ll show, using four examples, how to use this function. …
2012-04-15Making the AnaglyphWebGLRenderer a bit more protrudingThe WebGL-framework Three.js I mentioned in the previous entry has a nice variation of its renderer which renders scenes as red-cyan anaglyphs. So using Three.js, you basically get anaglyphs for free without any additional work on your part (an anaglyph is an image where you need glasses with red and cyan glasses to get a stereoscopic, three-dimensional view). I tried to construct a little scene using this ability, but what I disliked was that the scene, as an anaglyph, was too distant and appeared to be positioned behind the screen. I had a scene with several concentric circles of spheres, and I wanted them to appear to intersect the plane of the screen, with the center of the circles coinciding with the screen. And since I found no way of doing it, I plugged two new parameters into AnaglyphWebGLRenderer, called the new version ProtrudingAnaglyphWebGLRenderer and put it in a file ProtrudingAnaglyphWebGLRenderer.js. …
2012-04-15Modified TrackballControls for Three.jsWebGL is a technology that allows web browsers to display graphics using the fast routines of the graphics card, and Three.js is a framework which makes working with WebGL a lot easier. Among many other things, Three.js provides “controls”, Javascript objects which handle the interaction between mouse events and the WebGL canvas. One such control is TrackballControls. It maps mouse dragging gestures on an imaginary trackball and rotates the scene accordingly. I have used it to make models of polyhedra rotatable for my viewers: Stubsmütter und Tribanocci (a link to the German section of this blog). Per default, the imaginary Trackball fills the entire available browser window. This is less than ideal if the actual WebGL canvas is just a tiny illustration within a larger text: …
2011-11-03Mixing HTML and TeX in a StyledTextCtrl in wxPythonI have written my very own editor with syntax highlighting to write these sketches. This is far less impressive than it might appear on a first glance: wxWidgets, and therefore also wxPython, provide access to the Scintilla library via the StyledTextCtrl element, and this element can display HTML source code and style the different elements in different colors. Scintilla provides “lexers” for different languages, parsers which are able to determine which fragments of a document are keywords, identifiers, string literals, numerical literals, operators, comments and so on, and tokens from different categories can be styled differently. So “writing my own editor” in fact just means “gluing together some standard pieces”. It looks like this: …
2011-10-23The girl version of the “On the population dynamics of “Puella Magi Madoka Magica”” essayI’m not completely content with the appearance of the preceding sketch, and so I decided to try to prettify it a bit. I replaced all the equations generated by mimetex as GIF images with texts I pipe through MathJax, so if you have Javascript disabled, you’ll see all equations as \(\LaTeX\) plaintext. Furthermore, I replaced all the screencaps I took from OpenOffice or Excel and replaced them with with pretty matplotlib plots; and I also re-did all the previous matplotlib plots. And I tried to enhance the layout of the page a bit, and added more stills from the series. So this is my second take, the content remains unchanged, but I attempted to make the appearance more fitting for a series about cute girls. …
2011-10-16On the population dynamics of “Puella Magi Madoka Magica”This sketch is devoted to the population dynamics of the fictional world depicted by the Japanese animated TV series “Puella Magi Madoka Magica”. As such, it is inevitable going to reveal at least one major plot point. So if you are planning to watch this show, I suggest that you postpone reading this sketch until you are done watching it. You have been warned: there will be spoilers. …
2011-05-10Why I won’t update Orbit Classic for Firefox 4I hesitated updating Firefox to version 4.0, since I feared it might break a lot of extensions I use. Well, it certainly broke my theme Orbit Classic. But now that I made the transition, I decided that I won’t maintain Orbit Classic any longer. With Firefox 4.0, I’m happy with the default theme – all the more since it’s possible to cram all the chrome tightly together, so there isn’t much left to style anyway. It’s the compactness of Google Chrome combined with the awesome extensibility and flexibility of Firefox. …
2011-05-04Cascading Drop-ShadowsIn chapter 4 of “Interferences”, I’m using several layers stacked on top of each other with cumulative drop shadows. Of course I have written a Python extension for Inkscape to generate such cascading shadows automatically. Let’s start with a simple example: five rounded rectangles stacked upon each other. …
« previous page
(Page 1 of 2, totaling 14 entries)
next page »
| QuicksearchRecent Entries
ArchivesLatest Skizzenblog Entry |