Uwaga! Informacje na tej stronie mają ponad 6 lat. Nadal je udostępniam, ale prawdopodobnie nie odzwierciedlają one mojej aktualnej wiedzy ani przekonań.

Game Developer's Calculator

Version 1.0, April 2008

License: GNU GPL

DOWNLOAD: GameDevCalc_1-0.zip (53 KB)

SOURCE: GameDevCalc_1-0_src.zip (50.7 KB)

GameDev Calc is a calculator for game and graphics developers. It's different from standard Windows calculator, but I believe it's quite intuitive and useful.

The calculator is SIMD. It's just like manually executing shaders. Basic data type is not a single number, but a vector of up to four floating point numbers which you can treat as vector (x,y,z,w) or color (r,g,b,a).

Next to standard operations like addition, multiplication or sine, there are many special operations available, like calculating length of a vector. Available operations include:

- Finding minimum, maximum, clamping to 0..1 or to given range, linear interpolation.
- Normalizing vectors, calculating vector length, distance between points, dot product, cross product, vector projection, vector reflection.
- Converting angles between degrees and radians.
- Converting colors between RGB and HSB, calculating color brightness.
- Finding coefficients of linear and quadratic equation passing through given points.

The way GameDev Calc works is much different than traditional calculator, where you can see only the last number entered. Here you can see all the history of your computations in form of a stack and you perform all operations on this stack. For example, to calculate 2 * 3 + 4, you must:

- Add 2. Stack contains: 2.
- Add 3. Stack contains: 2 3.
- Perform multiplication. Stack contains: 2 3 6.
- Add 4. Stack contains: 2 3 6 4.
- Perform addition. Stack contains: 2 3 6 4 9. Result is at the end.

You can freely move vectors around the stack, delete them, duplicate them, insert separators and store vectors in additional memory, so you are not limited to operating only at the end of the stack.

GameDev Calc gives you possibility to read and enter vectors as strings in one of the standard formats or your custom formats that suit your needs. For example, you can write and read vector (0, 0.5, 0.752, 1.0) as:

- D3DXVECTOR4(0.0f, 0.5f, 0.752f, 1.0f)
- 0, 128, 192, 255
- 0xFF0080C0

Copyright © 2004-2024