Hello,
i try to apply distortion 3d mesh with irrlicht in real time.
I work on a game with a friend and we don't find how to do.
To be more precise, We want to apply distortion on an object that depend of positions of a cube's vertex.
I join a picture to try to explain this complex thing and hope that you undersand. Of course, on the picture it's with a square and not a cube.
Is it possible to apply this type of distortion on a 3d mesh?
I hope someone can answer...
distortion of 3d mesh with irrlicht
Re: distortion of 3d mesh with irrlicht
I think shaders could do it for you. Though shaders might be confusing at first atempts.
For example here's something ?similar? done in minecraft with shaders: http://www.youtube.com/watch?v=JpksyojwqzE.
For example here's something ?similar? done in minecraft with shaders: http://www.youtube.com/watch?v=JpksyojwqzE.
Last edited by serengeor on Sun Aug 07, 2011 11:28 pm, edited 1 time in total.
Working on game: Marrbles (Currently stopped).
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: distortion of 3d mesh with irrlicht
Such transformations are represented by transformation matrices. So just use the proper matrix on the mesh. If you want to do this continuously, you should probably use the dummy scene node to apply the matrix. As long as you only use homogenous transformations (the usual rotation, scale, and translation) it is also possible just with the standard scene node methods. Otherwise, you can also use the mesh manipulator, transforming the original vertices once and for all.
-
- Posts: 4
- Joined: Fri Aug 05, 2011 4:07 pm
Re: distortion of 3d mesh with irrlicht
Thank you for answer, i still search, your help is very usefull.
The shaders don't help me. I think understand that a shader is a distortion of an initial screen render.
I don't wan't apply distortion at all screen in 2d, but at a mesh model in 3d.
For using matrice, i have talked about this to my friend. It is a possibility but it is a big work to programming this.
A search more something like a particular physic engine that we can use to apply distortion on objects 3d AND use physics collisions.
Currently, we are using irrlicht and we try to apply distortion with bullet, the physic engine of blender.
That we try to do is calculate collision of soft body with bullet, and use irrlicht for screen render, for display 3d models at places that bullet say.
But even if bullet can calculate collision of soft body, i don't know if irrlicht will can appy distortion of our 3d models.
I am sorry for my language level, i try to be clear.
This picture show maybe more the type of distortion that we try to know do.
The shaders don't help me. I think understand that a shader is a distortion of an initial screen render.
I don't wan't apply distortion at all screen in 2d, but at a mesh model in 3d.
For using matrice, i have talked about this to my friend. It is a possibility but it is a big work to programming this.
A search more something like a particular physic engine that we can use to apply distortion on objects 3d AND use physics collisions.
Currently, we are using irrlicht and we try to apply distortion with bullet, the physic engine of blender.
That we try to do is calculate collision of soft body with bullet, and use irrlicht for screen render, for display 3d models at places that bullet say.
But even if bullet can calculate collision of soft body, i don't know if irrlicht will can appy distortion of our 3d models.
I am sorry for my language level, i try to be clear.
This picture show maybe more the type of distortion that we try to know do.
Re: distortion of 3d mesh with irrlicht
Shaders can be used to alter the render (post processing), but you may also transform things in 3d world AFAIK. You could apply specific materials to nodes and those nodes could be transformed in 3d space, without affecting the others.frerejeremie wrote:Thank you for answer, i still search, your help is very usefull.
The shaders don't help me. I think understand that a shader is a distortion of an initial screen render.
I don't wan't apply distortion at all screen in 2d, but at a mesh model in 3d.
But since from what understand you need dynamic meshes for rendering 3d bullet soft body representations, shaders wouldn't help much here i think, neither would transform matrices. You should look into dynamic meshes.frerejeremie wrote: Currently, we are using irrlicht and we try to apply distortion with bullet, the physic engine of blender.
That we try to do is calculate collision of soft body with bullet, and use irrlicht for screen render, for display 3d models at places that bullet say.
But even if bullet can calculate collision of soft body, i don't know if irrlicht will can appy distortion of our 3d models.
I think I saw some implementations of softbody rendering in irrlicht around forums, so you could try a bit of searching too.
Working on game: Marrbles (Currently stopped).
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: distortion of 3d mesh with irrlicht
Well, this new distrotion is fundamentally different than the former. Since you now have non-homogenous transformations. What you want to do here is moving the vertices manually or algorithmically. There's no function for this doing it easily. But you can write code that would move the vertices according to your intentions. Could be that physics engines have some support here, but not sure about that.
-
- Posts: 52
- Joined: Mon Jun 13, 2011 3:50 pm
Re: distortion of 3d mesh with irrlicht
well wouldn't the bottom line be best to use a shader? I mean if you do all those calculations on the CPU and you have more than like 8 or 16 vertices it would get hell'a slow.
Re: distortion of 3d mesh with irrlicht
I have no idea how could you get vertex positions from bullet to shader and apply them to irrlichts scene nodes. Is that even possible?HerrAlmanack wrote:well wouldn't the bottom line be best to use a shader? I mean if you do all those calculations on the CPU and you have more than like 8 or 16 vertices it would get hell'a slow.
Working on game: Marrbles (Currently stopped).