• Create Account

# coder0xff

Member Since 20 Jan 2005
Offline Last Active May 01 2014 06:22 PM

### #5044686The name of that floating-up fading number UI thingy?

Posted by on 19 March 2013 - 04:02 PM

When a numeric value appears above an opponent for the amount of damage you've done, and floats up slowly while fading out. Or when you gain XP, or earn money, or a myriad of other things. Is there a common name for this floating value thingy?

### #4846501Camera rotation from mouse

Posted by on 08 August 2011 - 08:56 PM

assuming that X goes to the side, Y goes forward, and Z goes up

```float pitchCos = Math.Cos(pitch);
Vector3 offset;
offset.X = Math.Sin(yaw) * pitchCos;
offset.Y = Math.Cos(yaw) * pitchCos;
offset.Z = Math.Sin(pitch);
Vector3 lookat = offset + cameraPos;```

### #4846457Camera rotation from mouse

Posted by on 08 August 2011 - 06:35 PM

The easiest way: keep track of a yaw variable and pitch variable. When the mouse moves you increase or decrease the yaw or pitch, based on the X and Y movement, respectively.

If you can't directly set the angle the camera is rotated to (or you haven't programmed it yet), reply and I'll show you how to compute the new look at coordinates based on yaw and pitch, or you can use the frustum building functions of the graphics library you are using to help you out. (Can you give some more details, please?)

If, for some reason, you can't keep track of a yaw and pitch variables yourself (and the camera you are using doesn't let you get or set them) then its possible to take the look at coordinates, compute the current angle, change the angle, and then compute new lookat coords.