# Thread: New to direct x, no idea what this means..

1. ## New to direct x, no idea what this means..

Ok, I saw a code that gives the coordinates to the camera. Here was the code
Code:
```#define CAMERA_X 0.0f
#define CAMERA_Y 4.0f
#define CAMERA_Z 7.0f```
this I would guess is a type of measurement, I dont know what it's using to place it. What does f mean? what does the entire number 4.0f mean? I dont get it, and theres nothing that explains it. This is one of the many things hendering me from getting through my book.

2. The f suffix on a floating point number just tells you that it is a float (the default is double)

So
Code:
```float a = 1.23f;
double b = 1.23;```

3. Those are preprocesser directives which tell the compiler to go throughout the source code, and replace all instances of CAMERA_X with 0.0f, CAMERA_Y with 4.0f, and CAMERA_Z with 7.0f. The f at the end of the number means the type is a float, not a double.

So if in your code you see:
Code:
`float x = CAMERA_X + 1.0f;`
The compiler would replace that with:
Code:
`float x = 0.0f + 1.0f;`

4. But I don't recommend hard-coding camera x,y,z values into the code. Ultimately you want a class to encapsulate a 3D camera and all its properties.

In DirectX those camera coords will place your camera at:

0 units off of the Y axis on the X axis.
4 units below the X axis on the Y axis.
7 units into the screen on the z axis.

In DirectX you normally have this setup.

X is negative as you move left and positive as you move right
Y is negative as you move up and positive as you move down
Z is negative TOWARDS the camera and positive AWAY FROM the camera or INTO the screen.

5. Even if you do want to hardcode the camera position, DON'T use #define. Use a constant instead. Defines are generally bad since:

¤ No type checking!
¤ Can replace other parts of the code if you're not careful!

Use
Code:
```const float CAMERA_X = 12.0f;
const float CAMERA_Y = 34.0f;```