Archive for December, 2006

From 0 to 2 in 1 Year

Monday, December 11th, 2006

I’ve just been invited to give one half of a two hour lecture at GDC 07. The talk is titled, “Advanced Tool Writing for 3ds Max and Maya”. I’ll be doing the 3ds Max part.

This talk is in addition to the Technical Artist roundtable sessions I will be running at GDC 07.

From a rejected talk for GDC 06 to a roundtable and talk at GDC 07. I’ve definitely achieved my goal of participating at an industry conference.

Why Use Only Two Instructions When You Can Do The Same Task With Four?

Wednesday, December 6th, 2006

I stumbled across the following line of code while reading through a MaxScript this morning:

size_label.text = (((siz * 100) as integer) / 100)) as string

That’s a multiply, cast, divide, and cast to get a float shown as a string reprensentation of an integer. The same operation can be done with just two casts as:

size_label.text = (siz as integer) as string

When you recast a float as an integer the decimal points get dropped automatically. Multiplying a float by a value to shift the decimal point, converting the result to an integer, and dividing by the same value will also give you a result with no decimal places. It’s slower and more obtuse, though.