Advertisement

Ninja Ropes

Started by September 24, 2000 09:56 PM
15 comments, last by wise_Guy 24 years, 3 months ago
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
Try a pre-calc/trig book.

Ben
Advertisement
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


sharewaregames.20m.com

Drawing the rope could use Bresenham''s algorithm, rather than the GDI line drawing functions.

------------------------------
#pragma twice


sharewaregames.20m.com

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
-----------------------------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
Advertisement
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
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


sharewaregames.20m.com

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
wise_guy Hehe, did you read his idea about having a deformable terrain by using a sort of "gel" landscape...
yep, this little page is a goldmine
-----------------------------Sancte Isidore ora pro nobis !

This topic is closed to new replies.

Advertisement