Thursday, February 28, 2008

What a Day!

This is not a technical post, this is a "Day in the Life of..." rant. So if you are only interested in the technical stuff, I am sorry to disappoint, but you can go ahead and stop here!

Today has been a bad day! Such a bad day, in fact, that it started yesterday! I have been at my new job now for about a month and a half, and I really like it! The people that I work with are great and the work itself is very interesting. Up until yesterday I had been eating lunch out, but I decided it would be more economical if I were to pack a lunch so I went to the store and got a bunch of the microwavable noodle packs and took one to work with me yesterday.

I put in the water and started the microwave. While waiting for the beep, I realized that we don't have any forks in the kitchen at work! With no other option I decided that I would do the best I could with my fingers. When the noodles finished I got them out of the microwave and headed to my desk. As I opened the lid to add in the packs of flavor I find that I didn't add enough water and there is a layer of noodles on top that are still hard! I put the flavor on the layer of hard noodles and it just sat there on top because I couldn't mix it. I ended up with hard noodles that were so spicy I cold hardly eat them and then a layer of completely bland cooked noodles.

Today I packed leftover spaghetti from dinner last night. I cracked the lid of the Tupperware and put it in the microwave. When it was done I took it out an put the lid back on. Then, all of a sudden, *BAM* the lid explodes off and spaghetti goes EVERYWHERE! While I was trying to clean it up one of the women who work in the office with me comes by and offers Lysol wipes. She brings them from her desk and starts helping me to clean up the mess. In the course of cleaning that mess we managed to knock over the coffee pot and spill the grounds everywhere! While we're trying to clean THAT mess up, my boss comes by, sees the mess and goes and gets vacuum! We got up all of the spaghetti and the coffee grounds but they stained the carpet!

After work I came home and decided to take out the trash. We live on the third floor and on the complete other side of the apartment complex from the trash area so we bought a tote to put the trash in so we can take it down stairs, put it in the trunk of the car and drive it over to the trash area. So I gather the trash, put it in the tote, put that in the trunk and walk to the driver's side door where I hear a hissing coming from my front tire. I look down and can actually see the tire going flat! I take the trash out of my trunk to get to the spare tire and the jack, neither of I've had to use since I got my car so I was pleasantly surprised to find that I have a full-sized spare instead of a doughnut. I jack up the car using the shoddy jack that comes with all cars and take off the flat tire. Sure enough it appears that I have run over some bit of metal. I put the spare against the wheel hub and find that I need to jack the car up more in order for it to fit. While jacking the car rolls backward, falls off the jack. The wheel well lands on the disconnected tire and the brake rotor lands on the ground. Now I can't get the tire out and I can't see if there is any damage to the rotor. I would be surprised if there isn't any damage since the whole car fell on it! Now I am waiting for the American Auto Association (AAA) to come with a proper jack to lift my car off the tire and see if there is any damage! What a day!

Thursday, February 14, 2008

Garmin Nüvifone

For those of you who don't know me personally, I am a huge gadget junkie! I love computers, PDA's, smartphone's anything portable with some brains to it! On that note Garmin one of the top GPS manufactures in the world has announced that they will be releasing a new smartphone in the third quarter of 2008! It is called the Nüvifone and will, of course, have an integrated GPS along with a whole host of other "iPhone-like" features!

There isn't much information currently about the specs of the device here's what I could glean from some web searches:
  • 3.5" TouchScreen, resolution unknown

  • Still / Video camera, resolution unknown

  • 3.5G HSDPA and Quad-band GSM

  • SMS / MMS

  • Email

  • Wifi

  • Bluetooth 2.0

  • Media player for MP3, AAC and MPEG4

  • GPS based on the SiRF III chipset

  • Pre-loaded maps with millions of points of interest

  • Integrates Google's Local Search capability


That's all so far, except that this video makes it look pretty darn slick!


I just got a Nokia N95 because of its integrated GPS and I am very happy with it, so I think I will stick with that for a while, but watch the Nüvifone VERY intently! That is, of course, unless Garmin invites me to participate in some kind of a beta test program! Then I'd happily test drive the phone for them!!

Friday, February 08, 2008

Ogre Material Editor TODO

I have messed with the controls in the Ogre window and I am pretty happy with them. I changed it so that the light stays positioned relative to the camera while you rotate the model and added the ability to move the light around. How it stands now is dragging with the left mouse button rotated the model, dragging with the middle mouse button moves the model, dragging with the right mouse button moves the light and scrolling the mouse wheel zooms. I have used the size of the model that is loaded as a "scale factor" for the moving and the zooming. There is nothing more annoying that having a tool that either moves so fast that the slightest motion wings things off the page, or so slow that you end up trying to zoom in for an hour to see a small model! To help this out even more I made sure that each time a model is loaded the camera is set up at a reasonable distance and position and if you hold shift while moving or zooming or rotating it goes much slower to give you the precision you might need.

Another nice thing is that the Ogre window has the option to become it's own free floating window. That way if you have two screens like me you can open the editor up in one and have the 3D window open full screen in the other! It's a nice set up!

I uploaded a video of the it working to Google and it really borked up the quality so I uploaded one to my website:
Material Editor Video (4.35MB)

I sat down last night and thought about all the things, great and small, I want this editor to be able to do and here's what I came up with:

  • [ ] Show the placement of the light with a transparent sphere

  • [ ] Change the properties of the light, i.e. color, dropoff

  • [ ] Change properties of the scene, i.e. background color, ambient light

  • [ ] Pick into the 3D scene and select items at the SubEntity level

  • [ ] Highlight the selected SubEntity

  • [ ] Apply materials at the SubEntity level

  • [ ] Drag and Drop in the project Tree

  • [ ] Swap OpenGL and DirectX on the fly

  • [ ] Save projects in an internal "binary" format

  • [ ] Load / Save .materials / .programs / shaders

  • [ ] Ability to change materials in either the scripts or widgets and have them stay in sync


If anyone has more suggestions or wishes to add to the list, I'd love to hear them.

xkcd

xkcd is one of the best web comics in existence! Today's strip is a wonderful example of why that is! It's a comic that is meant to be turned into a Mobius Strip and makes a cohesive story that way!

Thursday, February 07, 2008

wxBug

I am pretty new to wxWidgets so I wasn't surprised at all when I couldn't get icons to show up properly! Notice in the picture below how there is an icon next to Material, but not Project! My first thought was that maybe there was an issue with loading them from disk reliably so I converted them all to xpm's and included them in the source code. This didn't fix the problem but I still like this method better, you shouldn't need to distribute icons in png format with an application, that's just silly! The next this I did was post the question on the wxForum along with this picture and code snippet:



wxMenu* newMenu = new wxMenu();

newMenu->Append(ID_FILE_NEW_MENU_PROJECT, wxT("&Project..."))->SetBitmap
(IconManager::getSingleton().getIcon(IconManager::PROJECT_NEW));
newMenu->Append(ID_FILE_NEW_MENU_MATERIAL, wxT("&Material..."))->SetBitmap
(IconManager::getSingleton().getIcon(IconManager::MATERIAL));
newMenu->UpdateUI();


It turns out that it's a bug in wx! With this bit of code it creates the wxMenuItem, appends it to the wxMenu and THEN sets the Bitmap(a.k.a. icon) and there is an issue where doing things in this order cause the menu item not to be updated reliably! The fix is to create the menu item yourself and set the bitmap and THEN attach it to the menu. It's a few more lines of code and an additional local variable, but it's not too bad.

I also found out that when you listen for any kind of mouse button press in wx you need to event.Skip() when you're done to allow wx to continue processing the event and actually modify focus!

So last night I fixed the icons and added "ArcBall" like control to the Ogre window. I am not completely happy with how it handles yet. It's going to take some tweaking to get right. I have also decided to rethink what a "project" means. The previous code had a project that could have multiple materials, with multiple techniques, etc. In this paradigm there was only one material per .material file, which is not too horrible until you try to load in .material files that were created externally with multiple materials per file. In light of this I am going to add another layer in the project tree so that now each project can have multiple material files with multiple materials.

Wednesday, February 06, 2008

Ogre Material Editor

Over the summer I was a mentor for the Google Summer of Code and my student was working on a Material Editor for Ogre. He got a good bit done, but it is just such a large project that he couldn't finish it all. I have started tinkering with it, trying to see where it needs attention and where it's doing ok. He got a very nice framework set up and has almost all of the hooks in place to finish it off. There are still a lot of things to consider, but I think it's doable. I am not going to put a timetable on it becuase I intend to just tinker when I can. Any way, on to the eye candy!!!

MaterialEditor

I updated the wxOgre code and tweaked it a little to bring in the Ogre window, I'll update the Ogre wiki with the changes I made since it won't break anything and just makes it more robust. I also updated the splash screen to be inline with the new Ogre logo!

splash

I am really happy with the start my student made and I think that once it's done it is going to be a priceless asset!

Friday, January 25, 2008

Work!

I haven't had much time for extracurricular coding these last few days! We got a project in at work that we needed to code, basically from scratch, by Tuesday! This is my first project with this new company and we're putting in crazy hours, but the work in fun and the people are really great so it doesn't seem bad at all! I have a whole list of stuff to work on when I get some free time.

  • There is a bug in OgreAL::SoundManager::getSound() where is doesn't return the correct sound all the time

  • I need to finish implementing the soundFinished and soundLooped callbacks for kungfoomasta

  • I need to find a way to make the FadeLOD shader work with more complex models

  • I'd like to learn some HLSL so I can port FadeLOD to it for DirectX


There are a lot more "I'd like to..."'s but if I started that list it could go on forever! Anyway, I need to get in bed so I can get an early start tomorrow! That work project awaits!

Wednesday, January 16, 2008

I'm Back!

It has been FOREVER since I posted anything on here and a LOT has happened since then! I have moved back to Ohio, I was fired and found a new, even cooler job(!) and I have still been working on OgreAL and I just made an update to TwOgre. But in this post I want to talk about the OpenGL Shading Language (GLSL). I read the first 150 pages or so of the OpenGL Orange Book about a year ago but I just picked it back up since I have decided that I need to push some stuff off to the GPU. The first thing I wanted to do was fade between different LOD's. I tested it out by putting the different versions of a simple model into different Ogre::SubMeshes and setting them to fade at different distances. It works surprising well considering that it's really my first shader that actually *does* something! Here's a little video showing it in action:



You can see it fade between three different levels. The first is just a cube, the next is like a box with a solid center and the last is a box with a "mesh" center. The LOD distances are set really short so you can actually see it, in a real situation they would be farther apart.

I've also been playing with the shaders in the orange book and Ogre's material system and I am really liking what I am finding! Here is the Ogre Material to apply the Brick Shader from the Orange Book:

vertex_program BrickVert glsl
{
source Brick.vert
}

fragment_program BrickFrag glsl
{
source Brick.frag
}

material Brick
{
technique
{
pass
{
lighting off

vertex_program_ref BrickVert
{
}
fragment_program_ref BrickFrag
{
param_named brickColor float3 1.0 0.3 0.2
param_named mortarColor float3 0.85 0.86 0.84
param_named brickSize float2 3.5 1.5
param_named brickPercent float2 0.90 0.85
}
}
}
}


How simple is that?! And the best part is that you can inherit from other materials, so if you want a Yellow Brick Road, all you need to do is this:

material YellowBrick : Brick
{
technique
{
pass
{
fragment_program_ref
{
param_named brickColor float3 1.0 1.0 0.0
param_named mortarColor float3 1.0 1.0 0.85
}
}
}
}


And it takes all the information from the Brick material so you only need to put in what you want to change! Here are the results!

Normal Brick



a Yellow Brick



It's all a WHOLE lot of fun!!

Wednesday, April 11, 2007

Google SVN

Google is now hosting open source projects much like Sourceforge has done forever now. When I released OgreAL I put it up on Sourceforge, so I thought I would give Google a try with TwOgre. You can check out the project page at code.google.com. I made a good bit of progress on it this evening. I was able to integrate the AntTweakBar code into the same project as mine and build it as a unified library, either a dll or a statically-linked library. It's still missing the callback functionality, so for now the only way to get the data from the Variables is to poll them. It's not that bad if you're writing a small test, but if you are going to make a full-on World Editor, then you'll need the callbacks.

On another note, I have uploaded a couple of very interesting paper that my girlfriend has written. She is graduating from Cornell in May with an MBA and a focus on Brand Management. She also has a natural "techy" inclination (like anyone who didn't could stand to live with me! ). Anyway, the first paper is about AMD introducing their new Quad-Core processor and the market considerations with that, the second is my favorite, it's "Disruptive Technology of Games and 3D as Applied to the Virtual Environments and Serious Gaming" and discusses topics like augmented reality and innovative game play and how that affects (or will affect) the marketability of a product and the likelihood of adpption by the puiblic.

Tuesday, April 10, 2007

TwOgre

I recovered from wanting to kick myself in the face and redid all of the code that I had before and a lot more. I have completely wrapped the windows and all of the appropriate variables of AntTweakBar in a project that I am calling TwOgre. It has lead to my very first post on Ogre's Showcase forum!! Here are some pictures!







I still have to wrap up the callbacks and get TwOgre and AntTweakBar to build into the same static lib or dll. The callbacks are actually giving me a bit of trouble. I have never done that kind of thing before so I have a lot to learn!