Newton/Irrlicht Character Controller Demo update 10/28/05

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
_Dum0nde
Posts: 24
Joined: Thu Mar 17, 2005 3:26 pm

Post by _Dum0nde »

dhenton9000 wrote:First draft at:

http://www.sendmefile.com/00042869

Will add more if there's interest.

Sorry to dig an old thread but the link doesn't work anymore... Would it be possible to upload it again?

Thanks!
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

I've found a few bugs to fix, but in a day or two I'll post this to a permanent location.
Guest

Post by Guest »

Hi there. I tried your demo and got it compiled. It is very useful. I lightmapped your obj-level and reloaded it as my3d, but it does not work properly anymore. The collision is broken as i fall through the map (mainly in front of the switches i want to push,grr). The elevator seems to be stuck... I did not reposition a single vertex, i did no scale nothing just added some lights and rendered it. Then reloading as my3d and newirr is broken. Its really too bad. Maybe there is a way to load the lightmap and its uv's without using my3d? Or any other idea to get the lightmap would be very much appreciated. Please have a look, my maps look so shitty without lightmaps.

I can already get lightmaps to work without physics (just collision), but your example shows so much more that greedy me wants everything together. Any idea?
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

Anonymous wrote:Hi there. I tried your demo and got it compiled. It is very useful. I lightmapped your obj-level and reloaded it as my3d, but it does not work properly anymore. The collision is broken as i fall through the map (mainly in front of the switches i want to push,grr). The elevator seems to be stuck... I did not reposition a single vertex, i did no scale nothing just added some lights and rendered it. Then reloading as my3d and newirr is broken. Its really too bad. Maybe there is a way to load the lightmap and its uv's without using my3d? Or any other idea to get the lightmap would be very much appreciated. Please have a look, my maps look so shitty without lightmaps.

I can already get lightmaps to work without physics (just collision), but your example shows so much more that greedy me wants everything together. Any idea?

I've been working with another user who had the same problem. The issue is that the code that you have is loading data in the newton world via the function 3d coordinate function that's for non-lightmapped meshes. The red code below should be what you want to change.

Also, there is an assert(meshCount == 1) that may break with a lightmapped file. take that out or replace it with != 0, its in the same function.


Code: Select all



void CNewtonGame::createNewtonBase(scene::ISceneNode* iNode,scene::IAnimatedMesh* iMeshBase)

{



	
	NewtonCollision* newtonmap;
	newtonmap = NewtonCreateTreeCollision(nWorld, LevelCollisionCallback);
	NewtonConvexCollisionSetUserID(newtonmap,WORLD_ID);

	
	NewtonTreeCollisionBeginBuild(newtonmap);
	int  j;
	int v1i, v2i, v3i;
	IMeshBuffer *mb;

	vector3df vArray[3]; // vertex array (3*3 floats)

	int tmpCount = 0;
    int meshCount = iMeshBase->getMesh(0)->getMeshBufferCount();
	std::cout << meshCount;

Code: Select all

	//	assert(meshCount == 1);


//	assert(meshCount != 0);
   for (int x=0;x<meshCount;x++)
  {

       mb = iMeshBase->getMesh(0)->getMeshBuffer(x); 

       //video::S3DVertex* mb_vertices = (irr::video::S3DVertex*) mb->getVertices(); 
	   video::S3DVertex2TCoords* mb_vertices = (irr::video::S3DVertex2TCoords*) mb->getVertices(); 
[/color]


Code: Select all


       u16* mb_indices  = mb->getIndices(); 
       int maxI = mb->getIndexCount(); 
........


}








dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

This should be the permanent home of the latest files:


http://webpages.charter.net/hentond/images/newirr.zip
Guest

Post by Guest »

dhenton9000: You rock. That was really fast. Thanks for the help, when i get home i'll check it out straight. Yeah, that's it. BIG thanks.
Guest

Post by Guest »

Tried it and its still the same with the patch and with the new version. If i turn around after the start i can see that the normal mapped "kick box" also falls through the mesh. But it looks much better lightmapped. If you like, i can send or upload the bigbox_mod.my3d somewhere for you to try. I myself don't have the necessary skills at all, cause i can hardly code. I am more interested in 3D stuff especially lightmapping. Maybe we could even help each other.
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

Post the file to www.sendmefile.com and I'll see what I can do. A big downer to this code is that you have to do a lot of hand positioning to get things right.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Compiled fine for me first time compiling all these engines together and the sound was really cool... I fell through the elevator when crouching and was able to move some of the plateforms sideways the controls need a lot of work but overall this is a very education application.

Good Work. keep improving!
Fernando Alonso

Post by Fernando Alonso »

I have a question: I am trying to simulate the real movement of a FPS. In games type "quake" or " counter strike ", the movement of the FPS is linear, but when a person walks the force of the left leg and then the right leg makes to move itself the point of vision.
I would like to know if someone can help me with this simulation. I want to do a FPS that to the gait applies to him a light force of left side to right hand{side}, simulating the left leg, and then to apply a force of right hand{side} to left side, simulating the right leg, in addition to the force forward of walking.
I would like to know if someone might help me writing a very small demo, simply demonstrating as a FPS is controlled with newtown and irrlicht, or to to use the same demo (that of dethen9000) and to add to him these two forces in order to walking
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

Fernando Alonso wrote:I have a question: I am trying to simulate the real movement of a FPS. In games type "quake" or " counter strike ", the movement of the FPS is linear, but when a person walks the force of the left leg and then the right leg makes to move itself the point of vision....

There is a demo on the nehe site where they talked about "head bob"

http://nehe.gamedev.net/data/lessons/le ... ?lesson=10

During a walk cycle, the head moves up and down relative to the center of gravity, describing a sine wave (of sorts) if the center of gravity is moving in a line. Basically, when you walk you are constantly falling and catching yourself. The nehe demo shows this. The effect of the leg forces you are talking about is to move the head up and down.
Fernando Alonso

Post by Fernando Alonso »

you are right dhenton9000 . but, how simulate that with newton??
Do i must add a little force up-right or up-left to walking ??
:? .....
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

In my demo, the camera is not following a full physics model, so I'd fake it. In newton there is a call back for transforming your model that is called SetPlayerMeshTransformEvent or something like that. Its called after newton figures the physics for the current timestep. The newton data is used to position the camera. All you'd have to do is throw in a y displacement into that matrix and make it timebased. Probably a simple sine curve parametric with time. That function is called every clock tick, so it should do the trick.

That way, its not physics based, but just faked, so you don't have to be concerned about trying to build an accurate physics model of a biped.
Xaron
Posts: 310
Joined: Sun Oct 16, 2005 7:39 am
Location: Germany
Contact:

Post by Xaron »

dhenton9000 wrote:This should be the permanent home of the latest files:


http://webpages.charter.net/hentond/images/newirr.zip
Well, it doesn't seem to be soo permanent. ;) Can't reach this link.

Regards - Xaron
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

how about a new permanent home

http://www.s-fonline.com/webhosting/dhenton9000

It will be the permanent location, until it changes :wink:
Post Reply