PDA

View Full Version : initialization



fox
02-25-2002, 11:01 AM
Hi

I have an application where you can move a number of objects in a scene - to tilt the object I've initialized
m_xTilt=0.0; // in the constructor

glRotated(m_xTilt, 1.0, 0.0, 0.0);//in OnPaint()

it works fine - however I'd like to also have the option of tilting the object at a click of a button where the object is in the line of sight of a stick one metre high - which is in the centre of the circle and the object on its perimeter. I can get the object to translate and rotate at the click of a button but the code below for tilting doesn't seem to produce any results

m_xTilt = atan((height1-1.0)/object.m_dRadius);

//height1 is height of object at perimeter of circle
object.m_dRadius is the radius of the circle

is there any other way of writing this?

cheers