Jump to content

  • Log In with Google      Sign In   
  • Create Account


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

#5044686 The 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?

#4846501 Camera 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;

#4846457 Camera 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.

#581511 Quadruple Precision Floating-Point Library

Posted by on 04 September 2010 - 02:31 PM

I've written emulation for quadruple precision floats (IEEE-754-2008 binary128) in C++ and inline assembler, with a managed wrapper (for .Net languages). I understand the usefulness for this is very narrow, but wanted to share it anyway.

The reason I made this (for my own use) is that it has enough precision to represent each micrometer of the width of our observable universe. I've also included Log, Ln, Exp, Pow, Sin, Cos, Tan, ASin, ACos, ATan, ATan2, Ceiling, Floor, Round, Truncate, and Fraction. It also has Pi and E to full quadruple precision.