Skip to main content
gamedev.net
🔒 Locked

Vectors / Trajectory

Started by Sparky Jan 21, 2001 at 10:28 PM 1 replies 400+ views
Original Post
Sparky
Sparky
I have been working on a space flight/battle simulator. When the player fires a torpedo I want the torpedo to retain it''s initial trajectory. Right now it just follows along with the scene rotation. Do I need to calculate a trajectory for the torpedo or can I just use a sin/cos function to keep it on it''s current path? I''m getting the idea that this has something to do with vector math. If anyone has encountered this problem and knows of a solution please leave a post. Or point me in the right direction. Also, can I use dynamic allocation to create a torpedo and just delete it when it comes in contact with another object? ie... (Eplodes) I''m just drawing a simple 2d polygon and mapping an image to it. Is this the easiest way? Or is there something better that will speed up the game? So many questions and so little time! Heheh Sparky
Robert Snyder
soreno
soreno
Couldn''t you just use glPushMatrix() and glPopMatrix()

Eks:
glPushMatrix();
Render_Everything_that_don''t_rotate();
glPopMatrix();

glPushMatrix();
Render_What_Rotates();
glPopMatrix();

Mvh
Søren Olesen
zedzeek
zedzeek
speed is your LAST concern mate.

when u fire the topedo see what direction u fire it in (in the 3 axises) and every loop increase the position depending on that velocity plus ( a little bit of gravity ''prolly not important in the game you''re thinking of'' )

http://members.xoom.com/myBollux

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.