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 / Collisions

Author
Message
3DOO
19
Years of Service
User Offline
Joined: 22nd May 2005
Location: Amsterdam city!!!
Posted: 22nd May 2005 20:40
Hi,
I made a simple cottage from boxes, textured them and exported it to .x
My question is how to apply collisions to the .x model. Is it possible to create a new .x model and set it as collision shape?
I also want to know how to create a camera that smooth collides with walls. Now I have a camera that moves arround the level with the arrow and "a,z" keys, but it goes through walls.

Daniel

I come, I see and I walk away
3DOO
19
Years of Service
User Offline
Joined: 22nd May 2005
Location: Amsterdam city!!!
Posted: 22nd May 2005 23:28
Hi,
I have some noob questions about collisions and textures

-I made a building out of boxes and want to make the player collide on them. How do I set the building to correct collisions? The house consists of 200 boxes, so I can't program them all manually. I heard there was such a thing like polygon collision. But how do I activate it?

-I made a camera for first person move controll. I want the camera to smooth collide with the walls. How do I do this?

-How do you make parts of a picture transparent?

-how do LOD maps work

In the attachment is a shot from DB from my little cottage.


Daniel

I come, I see and I walk away

Attachments

Login to view attachments
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 23rd May 2005 04:42
Hey Daniel,

What version of DB are you using, Classic or Pro as this could make a difference, I only have Pro so unsure if the informaiton below will be any good for DBC.

For collision you can use the built in DBP collision commands but this will seriously damage your screen fps, I had created a quick polygone collision code which works for any .x model but its not on this PC, However if you search the DBP forums several people have posted codes and tutorials which you can use.

You say you want to make part of a picture transparent. Is this what you want? (Taken directly from DBPRO help files)

Quote: "
SET IMAGE COLORKEY
This command will set the general colorkey for all images. A colorkey allows you to specify a particular RGB colour that will be treated
as transparent by the image when used. Transparent pixels of an image are not drawn. You must use this command before loading or
grabbing an image in order that a suitable alpha map be generated from the transparent pixels of the desired image to be calculated.
The alpha map is then used to decide which pixels are drawn and which pixels are never rendered.

SYNTAX
SET IMAGE COLORKEY Red Value, Green Value, Blue Value
"



Or do you mean you want to change the alphablending of an object? If so use the command Ghost Object On [object number]

Finally if you mean an actual sprite picture, black is not drawn, creating an invisible effect, but to make a transparent effect you need to set the alpha of the sprite:

Quote: "
This command will set the alpha value of the specified sprite. The alpha controls how much of the sprite is present on screen and is
used to create a translucent sprite. The Alpha value range is 0 to 255, with 255 being completely solid and 0 being invisible. The
parameters should be specified using integer values.

SYNTAX
SET SPRITE ALPHA Sprite Number, Alpha Value
"



Hope this helps!

James

My first sexual experiance was in my girlfriends house, then she came down stairs and ruined it...
3DOO
19
Years of Service
User Offline
Joined: 22nd May 2005
Location: Amsterdam city!!!
Posted: 23rd May 2005 05:21
Thanx James for your reply. I use Dark Basic classic, because Dark Basic Pro uses DirectX9 and many of my customers don't have it installed.

I think I have solved the problem with the textures. I read somewhere that I need to do it with Photoshop, then make a transparent picture, then paint on it and save it as png or tiff.

The problem with the collisions is still there. It comes to hard coding, something I am not very good at.

Is there some kind of example of somebody who made a simple building with collisions using .x for a walk-through? This would be very handy. The code in most tutorials contains also code for AI, animations etc. and this makes it hard to understand.

Daniel

I come, I see and I walk away
3DOO
19
Years of Service
User Offline
Joined: 22nd May 2005
Location: Amsterdam city!!!
Posted: 23rd May 2005 06:30
AAAAAAAAAAAAHHHH....

Just when I thought I understood how the transparent pictures worked, I noticed that Dark Basic Classic with Enhancement pack duplicates all the jpg/png/targa pictures and converts them to bmp. Then in the game only bmp's are used, meaning no transparentpictures.........

HELP....

Daniel

I come, I see and I walk away
3DOO
19
Years of Service
User Offline
Joined: 22nd May 2005
Location: Amsterdam city!!!
Posted: 23rd May 2005 23:28
OK, I solved the transparency problem. It looks like Dark Basic does not accept jpg, tiff, png pictures.
What I did was create bmp's with black areas, then write "set object 1,1,0,1" bihind the load object string and then all the black became transparent.

But the collision problem still remains.

Daniel

I come, I see and I walk away
3DOO
19
Years of Service
User Offline
Joined: 22nd May 2005
Location: Amsterdam city!!!
Posted: 25th May 2005 03:20
New question. Does anybody know how to avoid this:
I made a level and applied fog. I set the sky and trees to not receive fog info and the rest of the level to receive the info. Problem is that now when I rotate the player I get a strange flash effect. At one point the floor is black, at a different point the floor is bright.

Anybody an idea how to get rid of this problem?

Problem:
[/img]http://www.3doo.nl/sample_work/incorrect.jpg[img]

[/img]http://www.3doo.nl/sample_work/correct.jpg[img]

I come, I see and I walk away
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 25th May 2005 12:14
Since your level is one object, it's probably confusing Direct X as to whether it should draw the floor or not. This can happen too if you have a lllooonnnggg object that extends from the back of the camera to the front. If the 'center' of the object is behind the camera to the extent that direct x stop drawing it (why should direct x spend time drawing something that's behind the camera?), then the portion in front of the camera disapears.

Short story long; turn off the fog on your level and turn it on for your trees.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 26th May 2005 03:19 Edited at: 26th May 2005 03:21
Im not sure how to help you with collison, I haven't used DBC in several years so unsure of the commands it can use.
Although its mostly math, I use Intersect Object (a DBP command) so my collisons wont be much help.
Although there slow, DBP have built in collisons


I have a feeling that one or two of these commands were in DBC, it would be in the Basic 3D commands section of the Help guide.

Sorry I cant be of much more help=/

James

[Edit]

You wouldnt be the first person to tackle collision in DBC, try searching and asking in the DBC forums - goodluck

My first sexual experiance was in my girlfriends house, then she came down stairs and ruined it...

Login to post a reply

Server time is: 2024-09-23 21:16:22
Your offset time is: 2024-09-23 21:16:22