[QUOTE=marahalsaidan;1250699]hello
I want from y
to gave me delay instruction in opengl
ex i want to draw sphere in first time then in second time i will draw cube etc.
how can i make this?[/QUOTE]
Does you mean that you want to draw sphere at current frame and then exchange the one to cube at next frame ?
If you want to do this thing, you can use the function glutSolidCube and glutSolidSphere with glut.
you can get the example and specification of those functions in Internet.
Then you can change drawn object by if-else statement in display function.
Does someone happen the odd situation as like as mine?
[ATTACH=CONFIG]419[/ATTACH]
I attempt to check my matrix, but I think that isn’t related with my problem.
Because I saw my plane looked like two different plane in large reflect angle.
This problem confuse me already two weeks.
And I have no idea how and what I should check.
My code is as follow :
vertex shader :
varying vec4 object_reflect_dir;
(In calculate world information function)
world_vertex = world_matrix * gl_Vertex;
world_normal = normalize(world_matrix * vec4(gl_Normal,0.0));
(In calculate world eye information function)
world_e = vec4(normalize(eye_position.xyz - world_vertex.xyz),0.0);
(In calculate world reflect dir information function)
vec4 world_reflect_dir = vec4(normalize(reflect((-1.0) * world_e.xyz,world_normal.xyz)),0.0);
object_reflect_dir = normalize(world_reflect_dir);
The reason causing the odd situation is that I normalize the vector from world eye position to world vertex position before calculate the reflect vector.
Maybe I should to calculate the mathematics about reflect vector calculating.