Entheogen

12-27-2005, 02:03 PM

how do i perform standard math functions like abs() or sqrt() on something like GLfloat ?

View Full Version : math with Gl datatypes

Entheogen

12-27-2005, 02:03 PM

how do i perform standard math functions like abs() or sqrt() on something like GLfloat ?

ZbuffeR

12-27-2005, 02: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.

Entheogen

12-27-2005, 02: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 :(

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 :(

ZbuffeR

12-27-2005, 03:30 PM

try this, maybe forget about r1 :

GLfloat f1 =0.3f;

float r1;

double r2;

r1 = abs((float)f1);

r2 = abs((double)f1);

GLfloat f1 =0.3f;

float r1;

double r2;

r1 = abs((float)f1);

r2 = abs((double)f1);

Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.