Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / fishing rod and wire

Author
Message
mihaid
14
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 5th Jul 2013 13:15
any ideas how to do this in the best way??, I'd like to make a fishing game in 3d...

Mihai
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 5th Jul 2013 13:56 Edited at: 5th Jul 2013 13:57
D3D has some 3D line commands which would come in use. Look up the command "D3d_Line3d".

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
mihaid
14
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 12th Jul 2013 08:23
OK, i made a line with d3d_line3d. I started to understand dow its working. Now my problem is to make a dynamic curve line, to change the rays, for instance when I want to launch the rod wire in the water...to be realistic....any suggestions???

Mihai
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 12th Jul 2013 10:44
Well, you need several 3D lines so that the fishing line can curve etc.

Usually, the most direct method would be to have an array of 3D positions that try and stay within a fixed distance from the previous position in the array. So, the first position would be the end of the rod, then the second position maybe a foot of line. Then each loop, you update the array positions depending on their velocity, then again to constrain them to a fixed distance. Add in gravity to the first calculation and believe it or not - you'll have a reasonable string simulation, especially if it's balanced right.

With those rules, you could add in that any position that's under the water gets it's velocity reduced by a great amount, otherwise the velocity is reduced slowly. With that, it should be possible to tighten and slacken the line just by moving the rod, letting the line sink etc.

I've gotten some nice results with this technique in 2D, I'll see if I can make time to come up with an example.

I got a fever, and the only prescription, is more memes.
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 14th Jul 2013 12:02
To do it convincingly will take some knowledge of physics and math. Specifically, as Van B said, you need to create a series of lines that will be connected to each other and make a series of arrays that correspond to the X, Y, and Z coordinates of the points where the lines segments join together.

To determine the values of the array is where the knowledge of physics and math will come into play, as you'll need to calculate the curvature of the line based on how the weight of the line makes it sag. If you're good at math but not so good at physics, you can make the line a simple parabolic curve.

Login to post a reply

Server time is: 2026-07-06 18:37:19
Your offset time is: 2026-07-06 18:37:19