View Full Version : Problem when shooting
Hi. I'm trying to create a platform that shots from the base of the screen. The base itself shots a line, but when I move the platform, the bullet moves with it. I think its something about the transformation matrix.
here is the code that i use
10-10-2004, 09:57 AM
Since I don't know the rest of your code I may be wrong, but from what I see a simple
right after your glClear should do it.
it sounds to me like your problem is more fundamental than an opengl issue. do you have a different x variable for your bullet, or are you just drawing it to the base x? this is a common problem for beginners because the pseudo-code sounds almost like it should work.
man, I am not using different variables for the bullet and the base. How I do that?
Well, look. I use a variable for the coordinate x of the bullent and other for the coordinate of the base. But my real problem is: the movement of the bullet when is shot is controlled by the idleFunc, but when i press a key to move the base, the bullet stops (because the key press is an event). How do I correct this?. A guy told me that I must put a call to the idle on the key press, but I dont think that is a good way.
Thanks for the help.
10-12-2004, 12:22 AM
You could do as "the guy" tells you, but by that your bullet will be slower or faster depending on your key-press behaviour.
So a (very) simple approach would be to put your rendering code and the coordinate modification of the bullet into a timer triggered function.
You want to initialize OpenGL?
DC := GetDC(Handle);
RC := CreateRenderingContext(DC, [opDoubleBuffered, 32, 24, 16, 0,0,0, InitPal);
try this... That perfect rendering.
Naphadol Mekiyanon [Dol]
10-12-2004, 02:15 AM
You should never need this in standard OpenGL applications. It doesn't work well/at all with depth test and if you don't have saturate blending enabled and sort polygons from front to back, this will not have any beneficial effect.
Some hardware just ignores it, the newer which doesn't will slow down and show artifacts.
If you don't know what you're doing, don't use GL_POLYGON_SMOOTH.
Bone01.x1[MTXSource, MTXTarget] := Sqrt((x1*x2)/(x1+x2))-Sqrt((x1*x1/x2)+(x2*x2/x1));
Bone01.y1[MTXSource, MTXTarget] := Sqrt((y1+(x1-z1)*(x2-z2)/((x2*y1)+(z2*y1))/(y2-y1));
Bone01.z1[MTXSource, MTXTarget] := Sqrt((z2*Sin(z1+z2))-(z1*(Cos(z1+z2)/(x2*x1)));
Woaw the central bone is great effectively movement to target.
If you want to other bone in human model that have 26 bones system.
I have controller bone module calculation more this..
E-mail to me : dol_3ddev@.hotmail.com
If don't connect to video card that is slower.
Do you use glGetString(GL_RENDERER); ?
I use in OpenGL 1.5 (dglOpenGL.dll).
10-12-2004, 04:52 AM
Can it be that you're a little confused?
You opened a new thread answering to this thread and wglGetProcAddress(glGetString(GL_RENDERER)) doesn't make the least sense.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.