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.

Code Snippets / 3D laser beam

Author
Message
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 23rd Feb 2005 07:14 Edited at: 24th Feb 2005 00:17
i created a method of making lasers for a project a while ago and decided to share it:

make the laser beam


position and show laser object


sorry for the lack of commenting in the code but i have a screenshot of two of them working:
http://www.lochviewwest.plus.com/ab5.jpg

scroll the texture every loop for a nice ripple effect. (if you have a wavy texture)

http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeom 9800se 128mb.
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 23rd Feb 2005 08:02 Edited at: 5th Apr 2005 08:26
edited a little cause someone's posts have been deleted.
positioning the laser: i knew how wide the mech was and how tall it was from its centre to the guns and put an object at its centre. then i rotated it the same as the mech and used the move object left and move object up commands feeding them the offsets of width and height. then i just got the dummy object's position and used it as sx#, sy# and sz#.

http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeon 9800se 128mb.
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 24th Feb 2005 00:19
sorry my fault, i originally had my lasers in an array and i missed one of the "(i)"s when i was removing them, here is what your code should look like:


thanks for pointing it out i've fixed the original post too

http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeom 9800se 128mb.
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 24th Feb 2005 02:37
d0se any one know how to do a flame thrower with darkbasic classic i have got this free thing off a magazine it creates like cool explosion and stuff "particle illsusion" i use them as texture then i would texture a cylinder or something has anyone got any better ideas
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 26th Feb 2005 08:44
if you are using dbp then use the intersect object command.

http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeom 9800se 128mb.
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 26th Feb 2005 23:30
If you aren't then get a dll and use the intersect object command!

[url]andrewneale2004@yahoo.com[/url]
http://www.elbsoftware.tk
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 27th Feb 2005 21:33 Edited at: 27th Feb 2005 21:34
yes i was going to suggest sparky's collision dll because it returns the x,y,z coords of the intersect and the normals for puting burn marks.

http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeom 9800se 128mb.

Login to post a reply

Server time is: 2024-11-23 14:07:34
Your offset time is: 2024-11-23 14:07:34