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 / Fun with bullet holes

Author
Message
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 15th Nov 2003 00:57
Yep they can be fun all by themselves:
greenlig
22
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 15th Nov 2003 01:32
hey that looks awsome!!!!!

Wanna help us ?

Anyway, it looks brilliant!



[href]www.glightdev.com[/href]

I got best and fairest for soccer WHOOHOOO!
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 15th Nov 2003 16:49
looks cool, can you tell how you did it?

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
M00NSHiNE
22
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 15th Nov 2003 20:13
Interesting....no doubt down to nuclearglory's dll

ZEDWARE website coming soon... //END TRANSMISSION//
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 15th Nov 2003 20:32
could just be a good bit of texturing
then again probably not


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 15th Nov 2003 20:34
What code/DLL is that ?

--Mouse: Famous (Avatarless) Fighting Furball

A very nice %it, indeed.
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 15th Nov 2003 21:32 Edited at: 15th Nov 2003 21:33
No dll, just plain old intersect object. No nuclearglory needed (yet) it's plenty fast enough.

My code basically sends out 3 lines when I shoot a bullet and gets 3 points of intersection and from that I compute angles using atanfull...
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 15th Nov 2003 21:44
k, I tried that too but no succes, but I disn't knew about the atanfull command so I did it with Atan commands, I'll try it out to

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
nuclear glory
22
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 15th Nov 2003 21:48
Greets,

That was a pretty clever idea ZomBfied.

The upcoming DLL release will have a ray-intersect command that returns the normals, position, and distance of collision against a mesh. It'll probably have a normal-2-angle converter, so you'd be able to do bullets and place the decals with only one ray-cast.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 15th Nov 2003 22:10
thats great, cant wait .
mean while, could you help me zomnbfied?

this is what I have to get the correct angles:



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 16th Nov 2003 03:39 Edited at: 16th Nov 2003 03:40
Cool beans nuclear! Right now my bulletholes actually only use 2 raycasts to just get a y angle. since there aren't a lot of steps or slanted surfaces except for rooftops I just make them flatten out if they hit the ground.
If you had a function that returned or set the values of xyz rotations of the "hit" surface that would rule.

Mussi, Your function looks neeter than mine...except it only looks like it does anything if you are shooting exactly in the z direction. How does that work?


One more question: Is there an advantage to declare locals in a function?
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 16th Nov 2003 21:27 Edited at: 16th Nov 2003 21:32
thats the prob , it doesn't work
so I'm asking for your help, how did you make the intersect line to "rotate" with the camera?

and yes, there is an advantage of declaring locals in a function, the x,y and z values arent used in other functions so I can give the same name (x,y,z) in other functions. less confusing

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
nuclear glory
22
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 16th Nov 2003 23:07
And in languages that take advatange of their resources (C++, etc...) the memory consumed by these local variables is freed when the function exits/returns.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 17th Nov 2003 02:53
Right, but all variables in db functions seem to be implicitly declared the first time you use them in a function and they are always local unless otherwise declared global somewhere.
You know what would be cool, if db had (and maybe it does for all I know) static variables. That is they are local to a function, but keep their value for the next time the function is called. Variables in functions in DB classic are always this way:

function addto()
i = i + 1
endfucntion i

in dbc this would return 1,2,3,4 respectively for each time you call it whereas in db pro this function would always return a 1.

Mussi As far as fixing you code: you have the TOx TOy and TOz just by making it z + 10000. To have it "shoot" forward from the camera I do something like instead of just moving the z coordinate, move the camera like so:

x1 = camera position x()
y1 = camera position y()
z1 = camera position z()

move camera 10000

x2 = camera position x()
y2 = camera position y()
z2 = camera position z()

move camera -10000

`(now you have a line where the camera would "shoot")

distance = intersect object(levelobj,x1,y1,z1,x2,y2,z2)
feiting
22
Years of Service
User Offline
Joined: 19th Oct 2003
Location:
Posted: 17th Nov 2003 03:51
I find it randomly chooses what's static and what's just local...

He who does not take the assassin job, will get killed by one who does.
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 19th Nov 2003 13:22
ZomBfied, think that should do for the rotating part , but I cant seem to get the correct angles . could you help me?

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 19th Nov 2003 20:34
Actually to tell you a secret I can't either except for the y angle. I just don't have a lot of slanted surfaces (except rooftops), so I made it 90 degrees if the x or z is different at all and it works pretty well.

In other words, when you check to see the difference when you move the point up in the y direction and get the distance, if the new points are different with respect to x or z then rotate the bullet hole 90,0,0 so it's flat.

If somebody could come up with one that does work for all the angles that would rule!
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 19th Nov 2003 21:44
hell it would, but don't expect some1 to come with it , guess we'll have to wait for the DLL

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 19th Nov 2003 22:40
But if you don't have too many sloped things (like ramps) or like if you're not walking around on a matrix type surface, then my method works great. You can shoot around all sides of a cylinder and the bullet holes are angled properly.

I just can't figure out why it doesn't work for the x and z angles too. Maybe it's the rotation order...
nuclear glory
22
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 20th Nov 2003 04:58 Edited at: 20th Nov 2003 05:00
Okay, good news!

The DLL ray-mesh intersect command is working great. It returns the precise hit position, hit normal, object hit, and distance to intersect.

Also, it has functions to convert the hit normal to angle data to properly align your decals to the surface of the model. It was tested on a fairly complex scene (not in the pics below) and worked well across all of the geometry.


Here are some pics of the ray-intersect and alignment code:
(The square in the middle of the screen is a plain object that would represent your decal. A ray is being casted from the camera's position to 100 units in front of the camera. And the plain is being aligned to the position and normal of collision)







The package is planned to release by Friday of next week (11-28-03) at the latest.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 20th Nov 2003 06:01
neat. How are you doing lightmapping? looks like multi texturing from here.

[P4 2.8C @ 3.03 with an 866mhz FSB:: MSI Neo-2LS running PAT:: 1gb Mushkin PC-3500 DDR High Perf level 2@ 2,2,2 :: ATI Radeon9800ProAIW :: 120Gb SeagateBarracuda 7,200RPM SATA HD :: Antec Plus1080AMG]
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 20th Nov 2003 06:07
Sweet. Now I can have all the fun in the world with bullet holes! Muh hah hahhahahahahhah
Gir
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Crazy Taco
Posted: 22nd Nov 2003 21:17
yeah im probly being really thick here but how do u get ur images onto the where your "bullet" or what every collided? dont know much about iomage manipulation, but i had a look around and could only get a 2d reference, no z value for your distance.

I'm makin' a cake...
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 22nd Nov 2003 21:25
I don't understand what your saying :S

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb ddr sdram
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 22nd Nov 2003 21:30
It's not image manipulation of any kind. It's a bunch of ghosted plains (like 100) that are hidden. Waiting. Like monsters under your bed. They have a bullet-hole texture on them. When you fire the gun, they reveal themselves at the exact spot where your virtual bullet hits a wall and they point themselves in the direction such that they look like they are glued to the wall. Like 1st grade art on your mom's frige.
Gir
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Crazy Taco
Posted: 22nd Nov 2003 21:42 Edited at: 22nd Nov 2003 21:56
yeah i thought of that bout 10 minutes after i posted this, well still cant get it working anyways but ill keep going at it

edit: and after looking at nuclearglory's screen shots,(which are very nice btw)

I'm makin' a cake...
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 22nd Nov 2003 23:29 Edited at: 22nd Nov 2003 23:29
@nuclear glory: Cool i tried doing something like that using intersect object, worked alright but i couldnt get the bullet hole to rotate to the same angle as the wall it hit so i gave up in the end.

Once you start down the Dark Path, forever will it dominate your destiny...
Gir
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Crazy Taco
Posted: 24th Nov 2003 00:48 Edited at: 24th Nov 2003 04:33
can anyone help, here is my code for bullet holes(well one bullet hole at the minute), works fine apart from when u turn around, starts going wrong when u turn 45 degrees left or right, and not at all at 180 degree turn. im pretty stuck so any help appreciated

Edit: its ok anyways i think im sortin' it

I'm makin' a cake...

Login to post a reply

Server time is: 2026-07-26 17:33:15
Your offset time is: 2026-07-26 17:33:15