More than one triangle selector

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

Not sure then. This tends to be a problem with normals going against the usual floor direction in my experience, but maybe there can be other reasons.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

yeah you might be right, I'll try the sliding value and report back I'll post a pic. Trying to think of something that could help this issue.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

http://youtu.be/JrdHIz5n-RQ

CuteAlien......^^^

Thought I'd post also that I set slide value to 1.5f.
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: More than one triangle selector

Post by Asimov »

Hi The_Glitch,

I don't know why, but your scene is vagely rememeniscent of a game I use to play on the zx spectrum, called Driller.
I have been reading this forum for a while and I keep seeing this triangle selecter. Can anyone explain what it is, and what it does?
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

It's a simple way for Irrlicht to have basic collision detection in your Irrlicht application without using a library like bullet physics, or PhysX.
Of course it has it's drawbacks as you can see in my video.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

@The_Glitch: Yeah, doesn't really seem to make sense in this case. Maybe polygon border - I hope changing slide values helps. I don't have an idea otherwise without debugging (and not easy to debug for me as I'm not that familiar with the collision code in Irrlicht as I'm always using my own code for this kind of stuff...).

@Asimov: It's about ITriangleSelector: http://irrlicht.sourceforge.net/docu/cl ... ector.html
As 3d artist you probably know that games use only triangles for rendering. But there is one problem when trying to use those triangles for other stuff like collisions - the triangles do not exist on the CPU. Instead index and vertex arrays are sent to the graphic card and only the GPU put's those together as triangles. So when you need triangles on the CPU you have to create them explicitly. That's what ITriangleSelector's are for - they create core::triangle3df arrays on the CPU from the geometry data. And those can be used for collision code. The_Glitch uses ISceneNodeAnimatorCollisionResponse for automatic collisions which collides a sphere against static triangle geometry - something used a lot in first person games (spheres approximate humans and allow for climbing minor steps).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

CuteAlien I did adjust the slide Value I put it at 1.5f but sadly nothing changed. I'll do some more test and post back.
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: More than one triangle selector

Post by Asimov »

Hi,
@Asimov: It's about ITriangleSelector: http://irrlicht.sourceforge.net/docu/cl ... ector.html
As 3d artist you probably know that games use only triangles for rendering. But there is one problem when trying to use those triangles for other stuff like collisions - the triangles do not exist on the CPU. Instead index and vertex arrays are sent to the graphic card and only the GPU put's those together as triangles. So when you need triangles on the CPU you have to create them explicitly. That's what ITriangleSelector's are for - they create core::triangle3df arrays on the CPU from the geometry data. And those can be used for collision code. The_Glitch uses ISceneNodeAnimatorCollisionResponse for automatic collisions which collides a sphere against static triangle geometry - something used a lot in first person games (spheres approximate humans and allow for climbing minor steps).
Ahh these are known as bounding boxes in Cryengine and Unty. A bounding box is basically a square box around your model. You can also have mesh bounding boxes, but these have a higher inpact on performance. Luckily I am hoping I won't need to use these in my game heh heh.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: More than one triangle selector

Post by CuteAlien »

No, bounding-boxes are boxes. Meaning you have usually a left-top and right-bottom. That's not a triangle. Triangle-selectors are triangles. They can form a box (you'll need 12 triangles for that), but they also can form the exact geometry of your mesh. If you work with 3DS-Max you should be familar with triangles I think... ITriangleSelector are the triangles you see there if you triangulize the whole mesh.

Irrlicht also has bounding-boxes.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

Use bounding box for simple meshes. For level geometry or worlds use the mesh itself.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: More than one triangle selector

Post by The_Glitch »

CuteAlien I believe your right about the normals of the environment. I changed around some code for the collision and used a plane as the ground mesh and the characters seem to navigate that pretty well. Still working out issue's for hit boxes as the under lying collision mesh Irrlicht likes you to use the same node for stuff lol.
Post Reply