View Full Version : math with Gl datatypes
12-27-2005, 03:03 PM
how do i perform standard math functions like abs() or sqrt() on something like GLfloat ?
12-27-2005, 03:10 PM
Actually this is pretty simple, head over gl.h to see how GLfloat is defined, in fact it is a good old float.
12-27-2005, 03:36 PM
Originally posted by ZbuffeR:
Actually this is pretty simple, head over gl.h to see how GLfloat is defined, in fact it is a good old float.well i see its a float, but it still doenst compile when i try to perform abs(GLfloat number)
or any other function from math.h library :(
12-27-2005, 04:30 PM
try this, maybe forget about r1 :
GLfloat f1 =0.3f;
r1 = abs((float)f1);
r2 = abs((double)f1);
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.