Tuesday, October 18, 2005

WDJ - Milestone 1 reached

Warwick has successfully reached milestone 1! I went through a series of Ogre3d tutorials and I learned how to render robots, and even ninjas! I put a light behind the ninja and turned on additive shadows, and he cast an ominous shadow. Then I put a purple spotlight on him, and he didn't look so tough anymore.

The winning code to display my title graphic looks like this:

void createScene(void) {
// Create background
material
MaterialPtr material =
MaterialManager::getSingleton().create("Background", "General");
material->getTechnique(0)->getPass(0)->
createTextureUnitState("warwtitle.png");

material->getTechnique(0)->getPass(0)->
setDepthCheckEnabled(false);

material->getTechnique(0)->getPass(0)->
setDepthWriteEnabled(false);

// Disable lighting on the background (it will show as fully lit)
material->getTechnique(0)->getPass(0)->
setLightingEnabled(false);

// Create background
rectangle
Rectangle2D* rect = new Rectangle2D(true);
// Cover the whole screen
rect->setCorners(-1.0, 1.0, 1.0, -1.0);
// Hacky, but we need to set the bounding box to something big
rect->setBoundingBox
(AxisAlignedBox(-100000.0*Vector3::UNIT_SCALE, 100000.0*Vector3::UNIT_SCALE));
rect->setMaterial("Background");
// Render the background before everything else rect->setRenderQueueGroup(RENDER_QUEUE_BACKGROUND);
// Attach background to the scene
SceneNode* node =
mSceneMgr->getRootSceneNode()->createChildSceneNode("Background");
node->attachObject(rect);
}


I don't think that will be my *final* version of that code, but it gets me to my next step at least.

On another note, I dropped by Cosmo Music and checked out guitars. The one that was recommended to me was the Yamaha FG700MS. The salesperson was not very helpful. After I told him that I was hoping to spend around $300, he just thrust this guitar in my hands and said "Here take this one". So I left with a business card, the model of the guitar, and the price of $239.99 written on it in a poor chickenscrawl.

I was going to dismiss the store outright after that encounter, but I read a lot of good things about the guitar on the Internet since then. I may just have to go back tomorrow and reconsider.

1 Comments:

At Wed Oct 19, 11:42:00 AM EST, Blogger D to tha L I C T said...

This is kind of unrelated, but I thought you guys might find this interesting. A Rifts video game (but you need an NGage): COOL!

 

Post a Comment

<< Home