I wrote something similar long time ago, these may be of some help:
To rotate / revolve node in world space & in local space:
http://irrlicht.sourceforge.net/forum/v ... =9&t=47924
Look at rotateNodeInLocalSpace() or revolveNodeInLocalSpace()
Regards,
smso
Search found 246 matches
- Fri May 07, 2021 9:28 am
- Forum: Advanced Help
- Topic: Matrix Rotation Around Local Axes
- Replies: 23
- Views: 5052
- Mon Aug 04, 2014 10:16 am
- Forum: Code Snippets
- Topic: Automatic Texture reload
- Replies: 9
- Views: 4849
Re: Automatic Texture reload
user
lolgamegd01
is a spammer
lolgamegd01
is a spammer
- Fri Jul 11, 2014 5:59 am
- Forum: Beginners Help
- Topic: trying to compile on linux.
- Replies: 1
- Views: 459
- Sat Jun 28, 2014 6:39 am
- Forum: Advanced Help
- Topic: Draw highlited 2d region on golf field
- Replies: 8
- Views: 1730
Re: Draw highlited 2d region on golf field
The following code fragments maybe helpful: using namespace irr; core::array<video::S3DVertex> Vertices; core::array<u16> Indices; void setupPixmapQuad() { Vertices.set_used(4); //S3DVertex => pos, normal, color, texcoords video::SColor color(128, 255, 255, 255); Vertices[0] = ...
- Fri Jun 20, 2014 3:54 pm
- Forum: Beginners Help
- Topic: Drawing a truncated cone
- Replies: 4
- Views: 557
Re: Drawing a truncated cone
See my code snippet to create a frustrum mesh:
http://irrlicht.sourceforge.net/forum/v ... =9&t=45413
Regards,
smso
http://irrlicht.sourceforge.net/forum/v ... =9&t=45413
Regards,
smso
- Mon Jan 20, 2014 5:48 am
- Forum: Beginners Help
- Topic: getHeight for animatedmesh or polygon mesh
- Replies: 3
- Views: 462
Re: getHeight for animatedmesh or polygon mesh
I used the transformed bounding box for finding the y-offset to prevent the character from walking below the ground, e.g. f32 getAnimatedMeshSceneNodeYOffset(scene::IAnimatedMeshSceneNode* node) { f32 scale = 1.0f; scene::ISceneNode* parent = node->getParent(); if (parent) scale...
- Mon Jan 20, 2014 5:39 am
- Forum: Advanced Help
- Topic: Drawing an icosahedron sphere with drawVertexPrimitiveList?
- Replies: 9
- Views: 1471
Re: Drawing an icosahedron sphere with drawVertexPrimitiveLi
Sure this can be done in irrlicht. Extract the vertices and indices from the data files by parsing with std::ifstream and std::stringstream. Then set up a scene::SMesh from the vertices and indices and create a scene::IMeshSceneNode for rendering. Cautious: Index in irrlicht starts from 0 instead of...
- Mon Dec 30, 2013 7:16 pm
- Forum: Advanced Help
- Topic: [SOLVED] screen space decals
- Replies: 11
- Views: 75863
Re: screen space decals - inverse world-view matrix problem
@arnir:
i.e. calculate invFinalMat outside the shader callback and send it to the shader callback at the proper moment.
Regards,
smso
Then you should update invFinalMat only when firing the gun,... (but follow geometry "under the decal" - it's good!)...
i.e. calculate invFinalMat outside the shader callback and send it to the shader callback at the proper moment.
Regards,
smso
- Sun Dec 29, 2013 10:46 pm
- Forum: Advanced Help
- Topic: [SOLVED] screen space decals
- Replies: 11
- Views: 75863
Re: screen space decals - inverse world-view matrix problem
Sorry, my fault.hendu wrote:No, the function does correspond to the multiplication (the fourth component of a 4-wide vector is simply ignored), and OP's case should indeed work.
I looked at the source code "matix4.h" and confirm hendu's saying.
Regards,
smso
- Fri Dec 27, 2013 3:52 pm
- Forum: Advanced Help
- Topic: [SOLVED] screen space decals
- Replies: 11
- Views: 75863
Re: screen space decals - inverse world-view matrix problem
The transformVect() function is not the same as "multiplication of vector by a matrix". Think about this:
matrix4 is 4x4 and vector3df is 3x1 (or 1x3 ?)...
Regards,
smso
matrix4 is 4x4 and vector3df is 3x1 (or 1x3 ?)...
Regards,
smso
- Wed Nov 06, 2013 5:12 pm
- Forum: Beginners Help
- Topic: how to make a smooth rotation?
- Replies: 6
- Views: 673
- Sun Sep 22, 2013 5:30 pm
- Forum: Beginners Help
- Topic: Apply a texture on a 3D model
- Replies: 1
- Views: 264
Re: Apply a texture on a 3D model
You should disable lighting for the node if no light was used:
Regards,
smso
Code: Select all
Nroom->setMaterialFlag(irr::video::EMF_LIGHTING, false);
smso
- Sun Sep 22, 2013 3:58 pm
- Forum: Beginners Help
- Topic: Rotating an Animated mesh scene node
- Replies: 7
- Views: 1122
Re: Rotating an Animated mesh scene node
It seems that your model is not centered at the origin. Try revolveNodeInLocalSpace() instead.
pivot is the offset from the origin
Regards,
smso
Code: Select all
void revolveNodeInLocalSpace(scene::ISceneNode* node, f32 degs, const core::vector3df& axis, const core::vector3df& pivot)
...
Regards,
smso
- Sun Sep 22, 2013 11:14 am
- Forum: Beginners Help
- Topic: Rotating an Animated mesh scene node
- Replies: 7
- Views: 1122
- Fri Sep 13, 2013 8:22 pm
- Forum: Beginners Help
- Topic: Camera Stuck In Mesh
- Replies: 4
- Views: 396
Re: Camera Stuck In Mesh
Try another mesh and/or turn on the debug data of the node.
Regards,
smso
Regards,
smso