Friday, September 20, 2013

More on the Design of WEBGL and the Origins of .OBJ


We have made a little progress in the last few days on both WebGL and the .OBJ origins issues.

This is an image from the current .OBJ object display software written for WebGL and written in Javascript/DOM/HTML.  Now, I doubt anyone actually needs a .OBJ viewer, its just a way to get familiar with displaying geometry with WebGL.

Instead of just showing you a picture, as I do, below, I should be able to just give you a URL so you can run it yourself, but I can't because I don't actually have a place to post the files for you to address (without seeing advertisements or in other ways compromising or inconveniencing my friends). The only web server I have access to is my own and it has only temporary IP addresses which Facebook will not even let me post. Besides, why bother to post a temporary IP address? I think it is funny how money controls everything, without money, our society says, don't even try to do anything.




So for fun I am posting this dilemma here and on Facebook, maybe someone will know where I can post some number of html and js files in a way that can be accessed by people on the net without inconveniencing them (e.g. no spyware, no ads, no Doubleclick tracking) at a price that even the poor can afford.

Regarding WebGL, once you realize that the designers had gutted it of any even slighlty higher level 3D and that this is a very low level interface to some of the power of the GPU without in any way providing even trivial conveniences for the programmer, everything is fine and you proceed.

I think they did this for good reasons. In the past, by making computers easier to use we opened the doors to allowing people to come in and take away our livelihood. The kind of conveniences I am talking about are trivial and do not hold back an experienced 3D technologist in the least (after they waste their time trying to figure out what the people who redesigned OpenGL were thinking ...).  (1)   So all that happens is that they inconvenience those who are writing their first 3D software and also tend to make such programs written to be a little more obscure because they will all be different (having to reinvent the wheel is trivial here, but since everyone will do it differently naturally it will be a little harder for someone to come in and read and modify because they will have to learn a new convention rather than rely on an industry-wide convention.)

I have no problem with this and in fact applaud it. As a victim of globalization and of the spread of these technologies, anything that makes knowledge that I have more arcane and valuable can only be good.

Regarding the .OBJ matter, we have learned both more and less. The ideas and the general approach to what the .OBJ format became was in the air at SIGGRAPH and the U of Utah in 1979 according to Frank Crow. According to Julian Gomez, there was no software from E&S that would have been an example of a .OBJ like format that would have come from them.   My leading hypothesis had been that the people at Abel's had received some sample software to (for example) load a geometric object and display it on the Picture System.   What would be a normal software development approach would be to start with that program and then write their own software on top of it.   Its an extension of the old joke that Unix only had one device driver (in other words, that everyone modified the original device driver when they had a new device to interface).  Julian may have written one of the first such "display an object" program at Andrews AFB long ago, but it did not use anything similar to a .OBJ-like format.

Julian also suggests that Mickey Mantle, who was in charge of customer support of E&S, may know more.

Thus it is still quite possible that the .OBJ format as we know it was based on ideas that were generally available but not based on specific code from a sample program, as I had expected. In other words, it may still turn out that the Abel version, written initially for motion control preview for Star Trek: The Motion Picture is the one that escaped into the wild (as I believe) and that it originated at Abel's, even if based on ideas more generally available.

 The time when this would have been written by the way is about 1977.

There is more to say, but also more to find out. I have been unable to find any early E&S documentation, for example, which would answer a lot of questions.

If anyone knows how to reach Mickey Mantle, please let me know.
_________________________________________

1. Well, that is not totally true.  OpenGL used to support drawing polygons, convex polygons, directly.  Now only triangles are supported so you have to subdivide into triangles yourself.  The problem is, this is a problem whose general case is actually fairly difficult.  Why not make everyone re-solve this themselves? Its good for them, it makes them think about fundamental principles.   I have no idea what these people were thinking.


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").