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.

Newcomers DBPro Corner / Newbie asks: How to connect two objects with thin rubber-line?

Author
Message
spidermann
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location: United States
Posted: 12th Jul 2003 20:25
Hi, maybe I am blind, but I cannot see the solution for this little problem: Want to connect two objects with a thin line. The objects will travel through space and line should shrink or lengthen according to the distance and orientation of the independent movements of the objects.
I will include a dbp-programm which shows the principle-scenario. Please fill your suggested code right in. Thx in advance.
Guyon
21
Years of Service
User Offline
Joined: 6th Jun 2003
Location: United States
Posted: 12th Jul 2003 21:23
A very simplistic answer might be to have different length line models (ie a small diameter rod) Then move the objects till the rods are about to come out the ends then switch to a shorter rod or longer as you need.
spidermann
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location: United States
Posted: 12th Jul 2003 21:59
hmm, thx for this suggestion, but...
Is'nt there any more precise solution? If, for instance, you want to show a blast of laserfire from one objekt to another, how will you do this (in 3d)?
As I mentioned, maybe I am blind to see the solution, but until now i did'nt find a logical and easy way to do this.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 12th Jul 2003 22:01
You would find the distance between two objects. Then, make a plain or something the size of that area, and position it between the two objects. If you want a lazer blast I would start at one object and scale the plain until its big enough. Make sure it is at the same level as the objects as well.

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
spidermann
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location: United States
Posted: 12th Jul 2003 22:19
Thx RPGamer,
yes, I can follow this solution, but...
Creating an object (plain or something else) is ok, but you have to rotate the new object every cycle towards the target, calculate the distance and (worst) have to calculate the scale factor in X-Y-Z direction as the target moves. This will take a lot of time.
So I has to ask again: is'nt there any other idea?
When you look and run my source code included to message nr.1, maybe then there will be the enlightenment.
Spider

Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Jul 2003 23:27 Edited at: 13th Jul 2003 16:40
this works useing scale object, I thought that might be too slow (you can see the box flicker and I thought it was due to slow object updates) but I just tried another way with precalculated sections and you still get the flicker, DB sometimes does that when there isn`t enough going on between sync`s, just gonna have another play, cheers.

Mentor.

PS: with sync rate 0 I get 541 fps so speed shouldn`t be an issue, my setup isn`t exactly high spec.

PPS that matrix robs lots of speed off the code, try replaceing it with a plain if that fits in with what you are trying to do, cheers

Login to post a reply

Server time is: 2024-09-20 15:44:37
Your offset time is: 2024-09-20 15:44:37