Ninja Ropes
Hello everyone!
In games such as worms, when you have a ninja rope, you can swing on it and it always stays the same length - like navigating the perimeter of a circle.
What I''m wondering is how do I draw the rope, (without using GDI), and how to find the end points of the rope. The length of the rope is always changing.
I''m really unsure how to approach this...
wise_guy
Basically, it will be easier if you use polar coordinates to keep track of the rope''s length and angle, and then transform them into cartesian coordinates when you want them displayed. Actually, getting realistic swinging with all the proper gravity is quite difficult, and I won''t go into it here.
------------------------------
#pragma twice
------------------------------
#pragma twice
Drawing the rope could use Bresenham''s algorithm, rather than the GDI line drawing functions.
------------------------------
#pragma twice
------------------------------
#pragma twice
This is the place to go Just look for his articles on cloth and especially string modelling. IF you don''t get any ideas from this, either I didn''t get your question, or you are not very creative
Good luck
Good luck
-----------------------------Sancte Isidore ora pro nobis !
Thanks a bunch guys!
ahw - what a goldmine! The string article will help me enourmously! Thank you very much!
furby100 - with polar coordinates, are you referring to imaginary numbers (i), coordinate geometry, vectors, (or maybe something completely different?) arrghh too many mathematical things use polar coordinates (for different things!). Also, what does #pragma mean?
But again, thanks very much
wise_guy
ahw - what a goldmine! The string article will help me enourmously! Thank you very much!
furby100 - with polar coordinates, are you referring to imaginary numbers (i), coordinate geometry, vectors, (or maybe something completely different?) arrghh too many mathematical things use polar coordinates (for different things!). Also, what does #pragma mean?
But again, thanks very much
wise_guy
Polar coordinates work the same way no matter where you use them. When using polar cordinates with complex numbers you place the real part of the number on the x axis and the imaginary on the y axis. As a matter fact polar cordinates are always used for the same thing, to represent a point in a cordinate system.
Snale
+--Java Game
Snale
+--Java Game
Snale+--My humble and superior homepage
In 2D, polar coordinates are an angle and and a radius to define a point; as opposed to cartesian coordinates which use the place where two perpendicular lines meet.
------------------------------
#pragma twice
------------------------------
#pragma twice
Brush up on your sine/cosine angle math and you should be in good shape.
RCode
http://progui.tripod.com/codeedu
Edited by - rcode on September 25, 2000 6:44:19 PM
RCode
http://progui.tripod.com/codeedu
Edited by - rcode on September 25, 2000 6:44:19 PM
RCode
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement