Parenting (Objects!) and Midterms

Posted: October 24, 2012 in INFR 3110
Tags: , ,

Seems I am falling behind on posts for Game Engines! Well here’s another update on my progress in the past couple of hectic days.

As for homework questions in the course goes, last week was a race to program and figure out the process of making a detailed solar planet model for a medium ranked question in the course.

The application had to show accurate planet rotations, orders, moons and when you clicked on the planets it had to show a HUD full of good ol’ info about the planet.

What I learned:

The main goal/purpose of this assignment question was to learn how to parent objects effectively (scene graph) and learn how to use Ogre3D’s ray casting functions.

How it looked:

Here is how my solar planet looked. Yes I know the Sun is too small. But oh well. I’m not an astronomer! I’m a programmer! 

Parenting:

For parenting, it was actually pretty easy. Every planet and moon needed to have it’s own node for the object to be drawn/attached to in addition to being a child node to a node that it would rotate around.

Moons would be parented (be children of) the planet they would orbit, and have their own node for the sphere to be drawn and textured. The planets would be children of the root node, which is the center of the solar system (the Sun).

Now, I made the mistake of making the Sun itself the root node at first. Why is this a problem you may ask? Well you see, if I made any changes in scale, rotation or position to the Sun, it would result in changing the attributes of all of the root node’s children. So if I scaled the Sun bigger, it would make all the other planets bigger too!

So in the end I learned I needed to attach the Sun separately.

Ray Casting:

In order to be able to select an object, I had to learn how to ray cast in Ogre3D. What this is is essentially a ray is shot from the cursor of your mouse into the screen. The cast will give you back whatever object it hits. Thankfully there is a build in iterator which helps you sort out the objects, and essentially find the object that is closest to you, which is what you want, since you want to select that object and not an object behind it.

This is a useful function to learn because it teaches us how to select an object, and discard any information about object selection with objects you do not want.

Midterm Summary/Reflection

This recent Monday, we had our Game Engine Design midterm. So how’d it go?

I believe I did okay. Not the best, but I certainly hope I passed! What would I have changed in preparation for the midterm? Studied more! Read all of the textbook chapters! I was crunched for time and did not read up on all the stuff I should have. After the midterm I started reading, and sure enough the next couple pages covered some questions in the midterm that I didn’t know how to answer!

 

So a good tip to my fellow students; READ THE TEXTBOOK! It really does help (for the stuff I did manage to read, I managed a great understanding of those concepts)

 

Also, brush up on your matrix/quaternion math. You should know that stuff all the time. Especially inverses.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s