Collision detection and response ( with codes )

Advanced game related topics
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

yes , i suppose is what it do :)


see the ogre.log
18:08:30: Parsing scripts for resource group General
18:08:30: Parsing script Castle.material
18:08:30: Parsing script WareHouse.material
18:08:30: Parsing script waterworld.material
Please correct my english
http://purebasic.developpez.com/
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Thx, I'll give it a try. It makes life much easier. It would be even nicer, if we could load .material file for each entity.
The Human Code Machine / Masters' Design Group
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

THCM wrote: It would be even nicer, if we could load .material file for each entity.
I do it for the robot.

1 - Use OgreXmlConverter to convert robot.mesh to robot.xml

2 - Edit robot.xml and change this line
<submesh material="Examples/Robot" usesharedvertices="false" use32bitindexes="false" operationtype="triangle_list">
to
<submesh material="Robot/Texture" usesharedvertices="false" use32bitindexes="false" operationtype="triangle_list">
3 - then create a file with wordpad robot.material
and copy this

Code: Select all

material Robot/Texture
{
    technique
    {
        pass
        {
            texture_unit
            {
                texture r2skin.jpg
                colour_op replace
                filtering trilinear
            }
        }
    }
}
4 - Now in your code you can write

Code: Select all

    Parse3DScripts()
    LoadMesh   (0, "Robot.mesh")
    CreateEntity (0, MeshID(0), 0)
If you dont want to edit robot.xml , you can create a file Robot.material

Code: Select all

material Examples/Robot
{
    technique
    {
        pass
        {
            texture_unit
            {
                texture r2skin.jpg
                colour_op replace
                filtering trilinear
            }
        }
    }
}
Please correct my english
http://purebasic.developpez.com/
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

This is all very cool! i have a few questions for you Comtois:

1. The test levels you made, were they created using DeleD?
2. If so, Does the created models & levels, etc retain all lighting correctly from DeleD?
3. Can you edit OGRE materials within DeleD and export them correctly?
4. Does the program seem stable and have rock solid OGRE .mesh output?
--Kale

Image
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Hihi Comtois,

Thx for your fast Answer =D

I ve been playing aroudn with DeleD myself for sometime, tho had to give up at some point because of the missing .material script support in PB. However this looks NICE !!

I managed to get the examples to run / also compile the examplecode.
Tho i was only able to do so under Windows XP not on Win2k Machines ( which i use for work ). I tried with newest Directx Drivers / Normal and Omega Drivers, also ATI / Nvidia make no difference ( the log is the same .. see above - Seems the Direct3D Layer isnt somehow correctly initialized on those systems ). Maybe Fred needs to take a quick look at it ( possible problem with the 3d lib ? ). However BuggySurTerrain runs fine also on 2k .. correctly initializing and shows textures / TnL.

Btw. one thing i noticed in your examples .. did you include / calculate the Lightmaps for those Scenes ? . if so they dont show here =)

Thalius
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Thalius wrote:Btw. one thing i noticed in your examples .. did you include / calculate the Lightmaps for those Scenes ? . if so they dont show here =)
Thats why i asked this:
2. If so, Does the created models & levels, etc retain all lighting correctly from DeleD?
because the samples look flat and not lit properly here too.
--Kale

Image
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Kale wrote:1. The test levels you made, were they created using DeleD?
I dont made the levels, they were with (in) the DeleD Lite.
2. If so, Does the created models & levels, etc retain all lighting correctly from DeleD?
I dont know , i just use Ogre Mesh Exporter for a quick try.I dont try light.
3. Can you edit OGRE materials within DeleD and export them correctly?
Yes , Mesh and material files were created by DeleD.
4. Does the program seem stable and have rock solid OGRE .mesh output?
It work with the examples , i think the best is you give a try by yourself :)

(Sorry for my poor english , i cant explain more)
Please correct my english
http://purebasic.developpez.com/
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Thalius wrote:Btw. one thing i noticed in your examples .. did you include / calculate the Lightmaps for those Scenes ? . if so they dont show here =)
No , i dont calculate the lightmaps , lightmap dont work with DeleD lite , you need version Pro.With DeleD Lite you can use Light point only , and i dont use it , i just made a quick test .
Please correct my english
http://purebasic.developpez.com/
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

*EDIT* Fixed verison for w2k online!

managed to get lightmaps to work with DeleD lite.
Even just one type of it.

Example Exe / Source / Data.
http://www.code5.ch/temp/test3d2.zip

The Trick was to rename the BMP Files generated by DeleD to .png ( and convert em of course ) plus editing the .material File ( a simple search / replace did it ). As Ogre Spits out the error that there is no loader codec for .bmp implemented and throws an exception otherwise.

Screenshot:
Image

@Fred's to Do List : :P
- Add/Compile in BMP support for Textures in Ogre.

Other than that ... now we can start making Games ! :D

Thalius
Last edited by Thalius on Fri Feb 10, 2006 5:54 pm, edited 2 times in total.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Thalius wrote:managed to get lightmaps to work with DeleD lite.
Even just one type of it.
Wow , i must give a try :)


I added collision , here are the files .

http://perso.wanadoo.fr/comtois/sources/Temple.zip
Please correct my english
http://purebasic.developpez.com/
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Comtois - Are you adding collision with the new beta commands? If so, could you post the source?
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

J. Baker wrote:Comtois - Are you adding collision with the new beta commands? If so, could you post the source?
No, i use my own collision detection.
The code is here , i use the same for all demos :
http://perso.wanadoo.fr/comtois/sources ... ssante.zip
Please correct my english
http://purebasic.developpez.com/
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Ok, thanks. Also, the last game test you posted, I'm getting just a black screen but I can see a white box in the corner which looks like it's calculating the fps.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

you need demo made by Thalius, i use his mesh for the last demo.

http://www.code5.ch/temp/test3d2.zip
Last edited by Comtois on Thu Feb 09, 2006 7:36 pm, edited 1 time in total.
Please correct my english
http://purebasic.developpez.com/
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Thalius wrote:Woot! Well if this would run in Win2K also it would be awesome!!
managed to get lightmaps to work with DeleD lite.
Even just one type of it.
Cool! i'm going to buy the Pro version later in the year.
--Kale

Image
Post Reply