Alright, so enough angry ranty posts.  I ran into this recently and it confused me for about 5 minutes before I figured out what was going on. Figured I’d make a posting about it.

So dynamic_pointer_cast makes use of RTTI. If you think about it, under different compiling circumstances the RTTI information will be different from compile to compile. So imagine if you compiled a shared library which some object that you intended to use dynamic_pointer_cast, it will work in the same library. However, if you’re in another library, you might get a NULL back. It’s a litte too early in the morning to get into the gory detail of it all. But you can work around by having a base class that has a method to do what you want. You could also cast using the raw pointer, but this might be going against what you intended originally.

http://www.libcinder.org

I’ve been friends with Andrew Bell for a long time, every since high school. Since I’m approaching 30, I guess I can say that’s a long time ago. While we are here to visit some old memories we’re also here to make new ones. If you haven’t heard, Cinder is going public this week. The world of creative coding will never be the same.

History
Since I’ve been friends with Andrew for so long, I’ve seen Cinder in its many forms and by its many names. A long time ago, in a computer lab in Richardson, TX – probably one of the first incarnation of Cinder was called HAGL: Hai and Andrew’s Graphics Library. I can’t recall specifically what was in it. But there wasn’t anything official to HAGL, it was just a bunch of source files that Andrew and I would often used in whole or in part for our various projects.

Some time later, parts of HAGL became what Bare Knuckle Software called libdt or lib digital terra. Digital Terra existed for a bit and released a game called: Atlas: Gift of the Aramai. I think the only thing in that project from HAGL was probably a PCX loader I wrote one evening at Andrew’s house. I’m not entirely sure why we kept using Digital Terra related names – but we did.

libdt went through two versions. The second version, by Andrew’s doing, became Flint. Flint was later renamed to Cinder for various reasons.

So one could say that Cinder has been 10+ years in the making and has been through various versions used in a variety of projects.

All that aside, what you will soon get is an open source library that comes with a whole arsenal of tools ready to meet any demands and challenges of creative coding going forward. But it doesn’t just stop there, Cinder will continue to be developed and expanded to a variety of different platforms. I bought an iPad recently with the specific intention of using Cinder to explore my crazy ideas.

Why Cinder?
There’s lots of ways to answer this question. The reason why someone should use Cinder in my opinion is because of its design and because of its design the power it brings to the table. Library design can be a difficult thing, especially if other people are using it. I believe that the people working on Cinder, mostly Andrew, strives to keep things sane for everyone that might use it. I’ve had lots of conversations with Andrew about how a Processing user might want to try to a certain component and what can be done to make it function the way they think it should. For someone like me, code philosophy is a big deal. It can make or break a system in the long run. Since there is a committed effort behind Cinder to keep things organized and well thought out for the users, it will have a long and prosperous life.

Is Cinder really that powerful?
Yes. One area that Andrew definitely has not shied away from is optimization. Wherever speed has matter, there has been a substantial amount of time invested into making it as optimal as possible. While there is always room for improvement, you can count on Cinder to be reliably fast in its operations.

Should I be using Cinder?
If you’re just starting out and are familiar with Java – you might want to check out Processing first. If you’re just starting out and are familiar with C++ – you might want to check out OpenFrameworks first. Why? While Cinder is designed to be coder friendly, it might be a bit much for your first go at this creative coding stuff. However, if you are up for a challenge, then by all means.

Have you used Cinder?
Yes. I worked with Andrew on the Augmented Reality project for Esquire. One of my major tasks on this project was writing an animation system that used data from Maya. Because of the way Cinder is designed, it was relatively easy to simply implement the animation algorithms once we had the data exported how we wanted. I’ve also written a few toy applications for Cinder.

So go check it out and make something awesome with Cinder. I’ll be right there with you, I’m hard at work porting the Moonshine code to be a Cinder component.

I guess a sunset photo is appropriate for today more than any other day. One of the best 3D generalist I knew passed away today. RIP James.

Click for bigger

Had some time this evening so went to two locations in an attempt to get some decent photos.



Click for bigger image


Click for bigger image


Click for bigger image


Click for bigger image


Click for bigger image


Click for bigger image


Click for bigger image

Futzed with the colors in Photoshop because clouds don’t naturally have this color unless you’re in Vanilla Sky or something. One day my fluid sims will run in less than a minute and look like this.

So I tried that entire taking a photo around the time of sunset – mostly because it’s hard to get up at sunrise. Here are the results. Click for bigger images.


Click for bigger image


Click for bigger image


Click for bigger image


Click for bigger image

I didn’t really know what to title this post, so I picked something very generic. There might be some truth to it.

I don’t know if anyone else feels or thinks this way, but I think it’s time someone calls the “code design” camp out. What do I mean? Code design is a crock and it pretty much is like the Abominable Snowman. It doesn’t exist. I think we tend to believe it exists in large because we see patterns in code. Now, it might be one of those religious type existences where some people would believe that we would have a lot more bad code if it weren’t for the morals held up by design principles, read religious tenants. Okay, so that might be jumping to conclusions too early. But lets break this down and see where we arrive at.

How Does One Design Code?
I think depending on who you ask, you will get various answers. Often, it’s really difficult to see what’s right and what’s wrong unless it’s just clearly wrong. I think the grand illusion here is that most people really want to believe that you can engineer code like you can something mechanical or electrical. I’m certainly not saying you can’t. However, the one thing that mechanical and electrical engineers don’t have to deal with often is scope creep. You’re going to have to think this one out for yourself. If you apply Internet Literal Quickest Path to Conclusion Logic to what I just said, you’re going to sound really stupid when you start to talk. Obviously, there are degrees of differences. If you have experience with attempting to design code, you’ll know what I mean. If you don’t, then keep trying to design code. My answer to this question is at the bottom.

What About Design Patterns?
You should probably know what they are for job interviews. There’s a weird double standard to this one. If you read the description for the design patterns, you generally think, “Oh wow, that’s what it’s called. I’ve used that so many times in the past!” But if you try to take one of those design patterns and use it in a design…how often does it really work out like you expected? I think they’re effective communication tools. I’ve always found that with a lot of force, you can generally make them fit. You might undo them later though.

…about job interviews…and then code…
So you go to an interview and they ask you all these questions about how you should do this and that? What do these words mean? What scenario would you use this design pattern in? You answer, get the job. You look at the code and what do you see? From my personal experience, I normally see a program that does a specific thing – absolved of any of the weirdo details that I was asked about in an interview. However, I do often hear those words I was asked about in the interview used in conversations about the code. But rarely do they transfer from the conversations directly into design except for variable names.

The Stupid Visio Diagrams
Does anyone really use this? I’ve seen charts at companies made from this stuff. But the few times I did try to follow the charts to see what went where – there were sections that were missing. When I asked about it, I was simply told, “oh, that didn’t really work out in practice.”

If you’re really intelligent and insightful and consider yourself intellectually above your peers, all of what I have said is stupid. Stop reading.

Now, if you have a real interest in figuring out one of the biggest problems that plague us coders, please continue.

I am certainly not advocating we don’t design our program and libraries. I am advocating we remove the ideas and concepts that have been dreamed up in the past two decades that do not work at all in code design.

I find myself designing code by thinking about a component I want to code and figuring out how to fit it into my existing code. To visualize this design, I will write pseudo code( read C++ ) to see if it compiles. Then I have it print function calls to make sure the ordering is correct. I rarely graph anything. I might right out the names of the variables.

I gave up on the code design books a few years ago. Their ideas always felt too restrictive for what I wanted to do. My approach is to see how things play out in practice. Code, to me, embodies a particular frame of thinking that postulates itself around requirements criteria at a certain time. Later on, I’ve often found that what I was thinking when I implemented these criteria isn’t robust enough. This is generally due to a better understanding of the problem and the elimination of requirements that didn’t make sense.

The motivation of this post comes from how Maya plug-ins are written in C++ and the love/hate relationship people have with them. I will expand on this in the next post.

There’s a lot of things I love about Boost. I mean a lot. However, there are a few things I absolute hate about Boost.

  1. boost::filesystem
  2. boost::program_options
  3. boost::iostreams

It’s hard for me to understand how these made it into Boost considering they have strict standards.

boost::filesystem
My first introduction to this was around version 1.29 – 1.31. At the time, the design philosophy for boost::filesystem was so far out in left field, it’s a wonder that people were able to use it at all. It was definitely a moment of when abstract concepts made its way into implementation. A lot of pedants will argue that you need to purely understand things like leaves and branches in a file system. That’s just plain dumb and silly. It’s a file system, treat it as one. We’re not dealing with generalize mathematics here. boost::filesystem is probably the biggest bait and switch scheme in all the bad boost libraries. It lures you in with promises of functionality only to find that it locks you into what amounts to a prison shower gang rape scene in a bad movie. I would go as far to say that it should be ejected from boost and redone completely by someone sane.

boost::program_options
Just stay away. Bait and switch as well, just not as bad.

boost::iostreams
Lack of documentation and examples. I’m pretty positive that this component is actually functional. But the lack of documentation and examples make it extremely frustrating to work with. I don’t know if it’s a philosophical thing as to why it’s not easy, but doing something like getting the position of the stream is not obvious. My obvious, I mean looking at the class and seeing something that looks like it could be what you want.

I recall a few years ago when AMD released the first 64-bit CPU. I was crazy excited, I downloaded the x86-64 release of Fedora right away and started mooking with it. I tried my hands at GCC in 64-bit mode. It was fun in a nerdy sort of way. I didn’t really know what to do with it, but it was exciting to know that I could. At the time I thought it was weird that x86 was just now getting 64-bit. I had believed that the transition to 64-bit had already been done and that x86 was just lagging behind. I also thought it was annoying that none of the major software vendors had made any effort on the 64-bit front. You had this really cool platform, but nothing to use on it.

Well, after a few years of first hand experience at 64-bit…I found out that for most people, the 64-bit transition had started. For some very high end users it might have ended and they have been on 64-bit since the dinosaurs roamed the earth. However, for the mass majority, the adventure was just beginning.

Herb Sutter said that the free lunch was over when CPU speed increases came to a bit of a halt. Now we had to learn how to use threads to get performance benefits. If that bit is comparable to a full blown meal such as lunch, I would say that moving to 64-bit is like getting a free snack at best. Depending on who gives it to you, the quality varies.

So here’s a few things I’ve ran into recently. This might or might not change in the next few days as I learn and discover new things.

  • Memory management is important as ever
  • More memory doesn’t always translate into bigger “stuff”
  • Using more memory means more memory access
  • More memory access can affect performance

Now, I work in CG. So the requirements for me is different from someone who works in games. The game guys have to be completely on top of their game when it comes to memory. I’m allowed to be a little sloppy here and there since I rarely ship an end product. Most of the time, the tool just has to work for the life cycle of the production. Attempting a full on clean design with the best practices of coding might end your project before you get to use it.

Anyway, I did have to work on rendering lots of stuff recently. Which means lots of geometry. So I thought, oh yeah, lots of memory lets just toss it all into the RAM and see how it does. Just in case you’re wondering – not a good strategy. Now, it might be that some of this software was just designed when memory size was more of a limitation so there are mechanism to help alleviate certain congestion so that gets in the way of other things now that we have more RAM. I can’t say for sure since I didn’t work on something like say, PRMan.

I won’t go into great detail here, but I noticed that when there are lots of geometry in the scene and PRMan couldn’t purge it. The renders would take a long time. So I reimplemented a DSO to give better bounding information so PRMan could purge it. This sped the rendering up quite a bit – as well as used less RAM.

In short, just because everything has a 64-bit label on it these days, doesn’t mean it will solve all your problems. It might solve some initial problems and give you an entirely new set of problems to solve.

This is pretty much a rant, you’ve been warned. But this crap comes up all the time and it’s really annoying.

If you’re a mathematician or coder I’ve been told that we’re not creative. In fact we’re the opposite of creative according to some very reliable sources. Apparently there have been studies done to show that people who are very technical are not creative at all. Even further, there is no amount of education or self will that can change this. As technical people we are beholden to a life lacking of all creativity. We can’t animate, light, draw, model or write. According to these reliable sources.

There are probably studies conducted right now to find the gene that locks into this lack of creativity. So the next time you think you’ve found a ‘creative’ solution to a problem. It’s not creative. I don’t know what word you would use to describe it. But it’s not creative, according to reliable sources who have read studies.

And if you don’t like what you see from these ‘creative’ individuals, it’s because you lack the ability to understand it – maybe even due to some genetic predisposition.

Also these studies have concluded, “Well, in general, a lot of technical people are that way.”

Where are all these studies? Who the hell knows.

It’s like Gattaca in real life – or maybe Idiocracy.