Sunday, September 15, 2013

Amazing Simulation of 1970s Graphics in WebGL


Its the mid 1970s all over again.

I actually have written my first WebGL application to display a .obj file.

First you have to convert the .obj to a ".json" file, and then type in its name to some code.  But this process which might seem awkward and stupid, is actually all the more authentic.  This makes the application feel even more 1970s with a retro user interface.

The image is of my test object, a viewpoint .obj of a playing card.   By being completely flat, believe it or not, I can test certain things in my code that was useful.  Yes I know, its not the most compelling 3D object you have ever seen, and you would not even guess that the object is lit, but it is.

So far I have only found one incompatibility between Firefox and Chrome, that being the ability to see the "." as in "period" in a javascript program.   Firefox can, Chrome can not.

The great advantage in having all this in HTML is that it provides all sorts of tools for layout, fonts, scrolling and so forth.  Thus the "program log" window on the far left scrolls which was trivial to implement.


Wow!  Thats exciting, isnt it !

Technical Notes

Ok, so the status display is wrong.  In fact this is the line segments of the very flat 3D object that you are seeing.   The display does not become correct until the user rotates the object and from that point forward it is correct.   Fixed in the next release.


Thursday, September 12, 2013

More Balanced Commentary on WebGL


No matter how frustrating the process, after a while one learns what can be done with a system and how to get around whatever it is you need to get around.   In this case the surprise was that I simply did not realize to what extent programming WebGL meant actually also working with both Html and the DOM, even though in retrospect it is obvious, and even more than that, this is what you would want.

You want it to be involved with HTML and the DOM or how could it all be integrated into the browser otherwise.

So its all good.  

There are some mysteries in the direction that OpenGL ES 2.0 has taken.   These mysteries can no doubt be explained by the designers, but they haven't done so, not that I have been able to find.  The specific questions involve the extreme position they seem to have taken to remove many things that people who program graphics use.   Its not so hard to implement your own versions of these things, e.g. a perspective matrix, a uniform variable to put it in, etc.   But it does make one wonder why they took it out to begin with?   Maybe they are just trying to be minimal?   That could be good.  But it is a little puzzling when you know the earlier versions of OpenGL and just leap into this and can not find things you expect.

Same question about perspective matrices also applies to lights.

And they seem to have some major browser architecture issue which I will call "the problem of the lost context".   Its annoying but can be managed.

On the positive side, by being so integrated with Html and DOM it is trivial to do multiple window layout and such things as scrolling text windows that might otherwise be difficult.

So far it seems to work and browser incompatibilities between Firefox and Chrome have been minimal.

Tuesday, September 10, 2013

Corruption and Degradation in WebGL (revised)


This review was written about a week ago when I was first into my learning curve of javascript, html, dom and webGL.  Well, its a week later and I think that what I was really responding to is / was different than what I thought it was.   Its not about WebGL, its about expectations.   See note at the end of the post.

This is a review on the process of learning Javascript and WebGL. The two are very interconnected and we will start with Javascript and then move to WebGL.

Note, I am not far enough along to have a real opinion about how well WebGL works, because I am spending all my time getting through the learning curve of getting a picture up on the screen. It shows promise, when things work it almost seems magical.

But when you first are learning WebGL you have to get through Javascript so we will start there.

Although Javascript is a little weird, it does grow on you, and there are clever even possibly reasonable solutions to various flaws in the language which, once you get used to their weird syntax, seem to be OK. For example, I am using a variation on the "module" pattern in Javascript and it seems to be working out for me in terms of hiding and keeping internal state of various parts of the program. Furthermore, javascript reminds me a bit of Lisp in its devil-may-care attitude to dynamic memory and its JSON equivalent of an S-Expression. Although initially dealing with Javascript is a problem, in time the problems fade into the background.

The problem is that learning Javascript is something of a pain in the ass, and for the following reasons:

1. Javascript has a specification and a bunch of tutorials, but no serious reference manual or best practices documentation. You are expected to get all that "out on the Internet". Ha.

2. The problem is that each of these tutorials is written by a different person with wildly different skill sets, styles and talent. They are not Kernighan and Ritchie. They are not comprehensive. They are occasionally helpful, they are more often then not incomplete or inaccurate. They are in no way a substitute for a good reference manual.

3. Each of these tutorials by helpful unpaid volunteers uses a different style, and a different set of support packages, all of which are completely incompatible with each other. There is no equivalent to "stdio" in Javascript. One person uses Ajax, another uses Jquery, still another uses something else. These different packages all seem to be useful, ad hoc, mutually incompatible and of wildly varying quality and utility.

4. Learning Javascript is usually intertwined with learning some combination of DOM and HTML, each of which exists in its own versions, varying implementations, and without documentation. Repeat problems of learning Javascript for each of these.

5. Unless you have someone with the knowledge and the time to guide you through this morass, you can count on a very frustrating period and a very time-inefficient process. Its nothing that anyone involved should be proud of. Just because they made a billion dollars at it, does not mean that they did a good job.

But the good news is that, so far at least, in conjunction with a nearly Lisp-like level of interactivity, one can pretty quickly get through the learning curve and onto whatever it is you wanted to do with the language.

But then you get to WebGL and you run into a series of problems which are very related to the ones just mentioned but with a few additional ones to make it all better. Not only is there no reference manual, nor anything close to minimally acceptable reference documentation (a specification is not a reference manual, by the way), but one more time we have the morass of internet tutorials that vary from useful to not, and each of them uses their own support packages for matrix operations and so forth.

But unlike Javascript, with WebGL and all modern graphics APIs, you have to do an awful lot correctly before you can put a cube on the screen. And if you do one of those 30 or 40 things incorrectly, then you will not see a cube on the screen. But each of those 30 or 40 things is badly documented since there is no reference manual, so you are reliant on Internet based tutorials which brings us full-circle on the discussion.

The only way I have found to proceed is to divide and conquer. Which is to work your way through the creation of a working program one module and WebGL call at a time, reverse engineer what the documentation should have been, and then move on.

That takes time.

I am not all that impressed, to tell you the truth.

So now it is a week or so since I wrote the above post.  And I think I was being a little harsh.  Once you get through the learning curve, and get a handle on what documentation that there is, one can become productive.  There are still unsolved riddles but I am able to move around them.   I think that the real problem here, however badly expressed, is one of incorrect expectations.  I expected things to be better, for us to go forward with the best, and not to have to deal with things that are no better designed or documented than what we had 20 years ago.   It is perhaps a let down that we have not come very far in certain ways and that is what I think I was expressing above, without knowing it.  As for the rest, Html, Dom, and even WebGL is fine, if a little weird now and then.




Monday, September 9, 2013

Global Wahrman Reorganization on 1st Anniversary


We plan to try different schemes to make individual posts on larger topics easier to find and perhaps even in a logical order.  This will take some time, and I probably have to try a lot of things before I find an approach that I like.  So there will be a fair amount of chaos here until it settles down.

Global Wahrman is one year old and I am very happy with parts of it.  But it is getting larger and harder to find things, or to know what is here.   It will take at least 5 years before I work through the backlog of topics, I think.

As you have noticed, posts come in several varieties here.  Although the trivial posts do not take very long to write, the more complicated ones are coming in at between 2 - 4 hours.  Some take more time than that.   I am not sure about the numbers but I would guess that for every post that is published, there is another post that did not get finished to my satisfaction and never posted.  It is the longer posts that are usually more interesting because more thought has gone into them and there is a topic behind them that I have usually thought about for a while.

The blog is very demanding, and it will be challenging to manage my time if and when I ever get busy in other parts of my life.


A Modest Solution to the Syrian Civil War and Related Regional Problems


When the domestic situation looks unsolvable it is a time honored solution to look to foreign policy as a way of distracting the locals from the government-created misery that is their life. Not only is this approach used successfully by governments, it can be used successfully by individuals to help avoid thinking and working on their own problems, a sort-of trickle down "distract the miserable" approach. Thus I have been putting considerable time into the Syria issue and whether we should start firing missiles at that part of the world.

The answer, I am happy to say is, No, we should not fire missiles. Nothing we do there will help the situation, anything that we do could have unforseen results. It is a no win situation for us. I am sorry that the Syrians and their neighbors are killing each other, and I am sorry that some of these people are assholes. But that is not a good enough reason to go to war.

But if you say we must do something, I have a proposal for you. I am sure that the small-minded scum in Washington will ignore my suggestion, but I am used to that. Pearls before Swine if you ask me.

If you want to help that region, forget about bombing Syria, ask yourself why is this region all fucked up (using the technical terms here, "fucked up"). What do the following countries have in common: Syria, Lebanon, Jordan, Saudi Arabia and Iraq? They were all created out of the former Ottoman Empire which is the country we now call Turkey. Turkey was also created at the end of WWI out of the former Ottoman Empire. This was all set up by the British and the French, mostly.

Since these countries clearly can not handle their affairs, I am referring to Syria, et alia, not England and France, and since this little British and French experiment in nation building is such a disaster, lets swallow our pride, and ask Turkey to come back, and manage the area for us. Forget about Syria, its just a province of the new Ottoman Empire, and better for it.

Bring back the Sublime Porte, the Grand Vizier, the Harem. All of it. I think that the world has given a good shot at letting the people of the region rule themselves, and they have proven to everyone how competent they are at it which is not very competent at all.

Lets admit our mistakes and bring back the Ottomans.

Furthermore, I predict that this will result in a massive increase in employment for certain technical people.  The Ottoman's were well known for the use of Unix, they had Unix everywhere, especially the Harem.

Perhaps the Harem is a problem for you, my sensitive, politically correct, white friend?  You might want to look into the role of women in the near east, first.  The Harem actually had quite a bit of power in the Ottoman empire.  More power than women have in politics in most of the contemporary Near East, I think.

Below we have a photograph of a classic Harem and concept art for a proposed anime-style modern Harem.




Also, the Ottoman's were quite stylish.  Check out the head gear, below.


Suleiman Himself


Map of the Ottoman Empire at its Largest


So in conclusion, by bringing back the Ottoman Empire to that part of the world, and getting rid of the current countries of Lebanon, Syria, Saudi Arabia, Iraq etc, we have a plan that will reduce violence, increase employment, elevate the role of women in their society, and add to sartorial elegance.  All of these things are good things, good for us and good for the region.

I hope you will support the campaign to restore the Ottoman Empire with your representatives in Washington.


Sunday, September 8, 2013

Request for Information About the Origin of the .OBJ Format


I am looking for information on the origins of the .obj 3D object format.  By the time I had arrived at Robert Abel & Associates in 1980 or so, it was already in use for our vector production system which ran on E&S Picture System 2s.  

My question is where it came from originally.  I had thought that it was indigenous to Abel's, but several people have told me that it wasn't and that it originated with Evans & Sutherland.  This makes sense but I have not been able to confirm it.

The reason I am so interested is because I think I was instrumental in extending this horrible format into raster graphics.  Its a long story and I want to get all my facts straight first.

If you know, or know someone at E&S I can talk to, leave a comment here or email me.  Thanks.



Saturday, September 7, 2013

Irresistable Videos on the Ancient Silk Road


In the world of archaeology, few topics are more interesting, controversial and entertaining than the whole combined issues of Indo European Language Dispersal and its dozens and dozens of mysteries and controversies.  You may not realize that you are living immersed in these mysteries, but you are, you are one of them.  You speak one (or more) of the languages that is at the heart of the mystery.

The Penn Museum had a seminar on some of these issues which had as speakers the superstars of this world: Colin Renfrew, J P Mallory, Victor Mair and so forth.

Its all online, which is wonderful.

Now you can waste another day or two of your life learning about this stuff.

See: http://www.youtube.com/watch?v=Z0HCs6PVnzI or all 10 seminars/talks at http://www.youtube.com/watch?v=QapUGZ0ObjA&list=PL286E934A56954D08




The Summer of SIGINT


The title of this post is a rip from a new blog I have been reading, the 20 Committee, which is written by a former NSA counterintelligence guy.

He has a lot of interesting things to say about Snowden, the NSA, Wikileaks, etc.  See his blog at
http://20committee.com.

I am pretty sure that recent events and disclosures do not mean what the Guardian and Snowden want you to think.    The question of the role of Wikileaks, which is not an innocent, activist, web site, looms larger.  The question of the probable moles in the intellilgence community signaled by the 10 illegals that were found in 2010 has not been answered. (For background on the illegals, see http://en.wikipedia.org/wiki/Illegals_Program).

I do think that big things are happening.   Are we in the opening stages of another war, or maybe its just a reminder that the intelligence war never went away.

Between the Canadian affair, the issue of the undiscovered moles, and Snowden's work for the Russians, it would appear that our intelligence community has been thoroughly penetrated.

Unfortunately, this is not a John LeCarre novel, this is real life, and I don't think there is any reason to think that the good guys necessarily have to win.


Monday, September 2, 2013

Philosophy and Shared Ideals in Computer Animation


[draft; being written; the following is at best a brief preamble to what I hope will be a major theme of this blog, which is a discussion of the history of ideas in computer animation]

Are there any ideas in computer animation?

Well, what a strange question to ask, of course there are ideas in computer animation.  For example, ray tracing, or radiosity, or antialiasing.   But that is not what I mean, exactly, although those are certainly good examples of ideas, or technologies, or inventions.

So idea is the wrong term or concept.     Maybe I am thinking of one of the other meanings of the word "philosophy".    "There are more things in heaven and hell, Horatio, than are dreamt of in your philosophy".    In this case I am referring to the underlying theory, the ideals, the shared beliefs, of the founders of a field, and whether those ideals and beliefs were vindicated, or corrupted, or forgotten or shown to be invalid or a mixed blessing or successful beyond their wildest dreams.

These beliefs might seem obvious to people today but were actually somewhat visionary when the field was being established.

Lets imagine what a shared ideal might be for another relatively recent field:  the field of modern aviation, or what was sometimes known as "powered flight".  One shared belief might be "Powered flight is possible and it will transform the world when it is invented".    Many, many people did not believe that powered flight was possible, and even if it was, they did not believe that it was practical, so this belief which may seem obvious to us, was certainly not obvious at the time.  Another example of a possible shared belief of many of the pioneers of aviation was "When powered flight is invented it will quickly obsolete all other forms of warfare".     This second belief, which was held by many of the early pioneers of flight, turned out to be more true than most people in the military believed, but less true than many of the pioneers had believed.  (See note 1)

So what would the shared ideals of the people who founded computer animation be?  What would it have been for the founders and inventors of the field, back when the field did not exist and most people did not believe that it was either possible or useful?

One of those beliefs might have been something as obvious as:  1. That we can create a formal written description of a scene (e.g. its objects, lights, materials) and translate that description into a 2D image (most images are 2D, traditionally speaking) that might appear 'real'.

Certainly that was a fundamental belief of the pioneers, so fundamental that it might never or rarely even been articulated.  Of course, I object that culturally-laden term 'real'.  "Reality is a useful measure of complexity", Alvy Ray Smith was alleged to have said, although he denies it.  Still, I personally think that many non-professionals, and far too many professionals as well, misunderstand and overemphasize this issue of apparent reality as we have argued on this blog.

Another shared ideal might be, 2. The use of a branch of mathematics, computational geometry, in conjunction with various 3D visualization techniques as well as modelling techniques of other types such as finite-element analysis, will prove to be a qualitatively important tool in architectural and mechanical design.

Or it might be, 3. the use of various visualization techniques when applied to concepts and ideas in sciences such as astronomy or particle physics will not only result in materials to help explain those ideas, but will assist in the further development of those ideas in their respective fields.

In other words, its not just that visualization helps to understand concepts in astrophysics such as galaxy collision, but will actually help scientists develop new ideas in their field (not just outreach but a tool of the fundamental research as well).

Or it might be, "4. the use of techniques such as 3D visualization and image processing, will result in a transformation of the cinematic production process and will lead to fundamentally new types of content in traditional media such as cinema, and that this new content will be culturally important" 

I am differentiating here between traditional narrative media and emerging interactive media because I think that they are very different things.

This is not an exhaustive list, at least I hope not, nor is it intended to be.  It is a list to help stimulate discussion and better refine what "shared ideals in computer animation" might be.

But if we do look at this list of 4 points, I would suggest to you that 1 and 2 are valid, that 3 has not occurred (e.g. visualization has not been recognized as contributing substantially to the research in those fields, although it is used for outreach), and that 4, that we would help to create new and interesting content in cinema is debatable even as our techniques have been used throughout the production process. 

Why debatable?  Because the bitter truth is that not all society recognizes or is willing to acknowledge the fundamental cultural importance of giant robots and superheroes/heroines in cinema.  It may indeed be a long time until Scooby Doo in 3D is acknowledged for its impact on the cinema, and on our society as well.

In other words, sure the use of computers in general and computer graphics in particular has changed movies, television, etc, but has it make it substantially better in terms of content?  Or make it worse?  How about just different ?     I think that it has been a mixed bag, actually. 

So what are the other ideals and shared beliefs, articulated or not, behind computer animation and computer graphics?

________________________________________________

1. The history of the origins of powered flight is deeply intertwined with the history of the transformation of warfare of the 20th century.   The Wright Brothers demonstrated powered flight in 1903 in a very early form.  By 1914, or a mere 11 years later, a much more advanced version of the airplane was already flying for the armed forces of all sides in Europe and the at least one of the sides in the Middle East.   Yet ultimately the belief of many early aviators, that all other forms of warfare would be replaced by the airplane, did not turn out to be true.   "Air Power" was important, it may or may not have been "decisive", but it was not the end of warfare as we knew it.  For a good history of this, see (insert reference for makers of modern strategy essay on "air power").



Saturday, August 31, 2013

The Uses of Snowden: The UN Universal Declaration of Human Rights


When Ed Snowden, our pissy and so self-righteous Defender of the Faith and of All Truth, who Sees the Higher Path and knows What is Right when none of his thousands of colleagues do, who knows what MUST be done to save America when all around him everyone else is Corrupted by Mammon or one of the other Seven Princes of Hell, when this icon of moral and ethical perfection had his passport pulled by the State Department (surprise!!) he complained that the USA was violating a clause of the UN Universal Declaration of Human Rights and inhibiting his right to travel internationally and to seek asylum.

Now that is interesting, I thought to myself. One more time, Snowden may have brought to our attention some topic of merit that is, apparently, separate from the national security ones on which his reputation ultimately depends.

What is the "UN Universal Declaration of Human Rights" anyway, where did it come from, and what does it all mean?

It was written right after WW II and at the very dawn of the United Nations.  The head of the committee that wrote it was none other than Eleanor Roosevelt, former first lady of the United States.  You can read all about it at the link I provide below.   The key to understanding this Declaration is to understand, somehow, that WW II was much worse than you think it was and that people, some people at least, were idealistic about a new beginning when the war ended.  And so, this international committee of idealists and intellectuals put together a short list of things that "would be nice".

Wouldn't it be nice if everyone could be educated?  Yes.  Wouldn't it be nice if there could be freedom of religion?  Sure.   Wouldn't it be nice if people could express their beliefs freely, and travel wherever they wanted, and made a living that allowed them to realize their potential and not be thrown in jail without due cause?  Absolutely!  And so forth, and so on.  

Here is what it says:
Now, Therefore THE GENERAL ASSEMBLY proclaims THIS UNIVERSAL DECLARATION OF HUMAN RIGHTS as a common standard of achievement for all peoples and all nations, to the end that every individual and every organ of society, keeping this Declaration constantly in mind, shall strive by teaching and education to promote respect for these rights and freedoms and by progressive measures, national and international, to secure their universal and effective recognition and observance, both among the peoples of Member States themselves and among the peoples of territories under their jurisdiction.
My goodness, that is nice.  Constantly in mind!  Shall Strive by Teaching!  Progressive Measures!

Forgive me for being a little cynical here but we are talking about 1948 or so: Stalin is wiping out entire minority groups, people are being thrown out of windows in Czechoslovakia, Mao is demonstrating what he meant by "all power comes out of the barrel of a gun", the colonial empires of various western empires are meeting the post-WW 2 anti-colonial movements of S.E. Asia and Africa, and these fluffy liberals are making Universal Declarations of Human Rights.

The United Nations Universal Declaration of Human Rights is about 2.5 typewritten pages long, and is very easy to read. It is at: http://www.un.org/en/documents/udhr/

Now that you have read it, ask yourself how many of these have been violated by this country, the United States of America, in letter or in spirit, at least occasionally?

Just off the top of my head I can make arguments that we are or have been in violation of Articles 1, 2, 3, 5, 7, 8, 9, 11.1, 12, 13.1 and 13.2, 14.1, 15.2, 16.1, 17.2, 21.1, 21.2 and 21.3, 23.1, 23.2, 23.3 and 23.4, 25.1, 26.1, 26.3 and I can make a case for a few of the others as well.

I doubt that there is a country on earth that could live up to these standards if they are interpreted as they are probably meant to be interpreted. So what is this anyway? Is it treaty? Is it law? Is it international law? It is none of these things.  In the words of Eleanor Roosevelt, Chairperson of the UN Commission on Human Rights, when the declaration was being drafted and when it was introduced to the General Assembly to be adopted:
In giving our approval to the declaration today, it is of primary importance that we keep clearly in mind the basic character of the document. It is not a treaty; it is not an international agreement. It is not and does not purport to be a statement of law or of legal obligation. It is a declaration of basic principles of human rights and freedoms, to be stamped with the approval of the General Assembly by formal vote of its members, and to serve as a common standard of achievement for all peoples of all nations.
In fact, the impact of the Declaration and its legal status many years later makes more interesting reading than the declaration itself. Its a complicated tangle but it can be said that the Declaration has in fact had some influence, presumably positive influence, in many situations internationally over the years. Whether this influence has affected peoples' lives or whether it is in words and paper only, I couldn't tell you.

But I can tell you, that no country on this planet would believe that this Declaration prevented them from trying to bring into custody someone they considered a criminal, and that therefore Snowden accusing the US of being in violation of this Declaration is somewhere between naive and comical.

Which is how I think history will judge Snowden overall.

Naive, very naive.