Thanks, it worked. It is quite costly. For now I've figured out an alternate (call setScale only once I'm doing editing vertices).
However, why doesn't sceneManager->getMeshManipulator()->recalculateNormals( meshBuffer); work? It doesn't seem to be as costly as setScale.
Search found 22 matches
- Wed Sep 28, 2011 12:06 pm
- Forum: Advanced Help
- Topic: Mesh normals not changing or messed up after altering mesh?
- Replies: 3
- Views: 527
- Tue Sep 27, 2011 7:00 pm
- Forum: Advanced Help
- Topic: Mesh normals not changing or messed up after altering mesh?
- Replies: 3
- Views: 527
Mesh normals not changing or messed up after altering mesh?
Hi, So I wrote a basic terrain editor. My terrain has a shader which uses normals (NORMAL semantic) to calculate lighting and the texture blending. However, whenever I alter the mesh's vertices's positions manually, then the shader won't update the lighting/texture on the mesh itself until I've comp...
- Sun Sep 25, 2011 8:48 pm
- Forum: Beginners Help
- Topic: Raycasting not accurate after manually altering mesh?
- Replies: 2
- Views: 289
Re: Raycasting not accurate after manually altering mesh?
I thought that when "refreshing" the mesh (node->setPosition( node->getPosition() )) it would automatically recalculate the terrain triangle selector. But I'm probably wrong, I'll check it out, thanks.
- Sun Sep 25, 2011 7:05 pm
- Forum: Beginners Help
- Topic: Raycasting not accurate after manually altering mesh?
- Replies: 2
- Views: 289
Raycasting not accurate after manually altering mesh?
Hi, I use a very simple raycast function to get the Y height of the collision point from the camera to the terrain (cast ray from camera->getPosition() to camera->getPosition() + vector3df( 0, -10000, 0 ) ). However, after manually moving the terrains vertices up/down, the Y position of the ray stay...
- Wed Mar 23, 2011 1:12 pm
- Forum: Project Announcements
- Topic: TrollBrad [Free][RPG+RTS][WIP][TECHDEMO]
- Replies: 35
- Views: 14721
- Wed Mar 23, 2011 1:10 pm
- Forum: Beginners Help
- Topic: Animation not displayed/rendered?
- Replies: 2
- Views: 290
- Wed Mar 23, 2011 1:05 pm
- Forum: Project Announcements
- Topic: irrBP - An Irrlicht - Bullet Physics Wrapper
- Replies: 200
- Views: 113059
Does anybody have a idea how I could implement a simple function like bool OnGround() using IrrBP? I know how to do it with the default Irrlicht collision manager (shoot a ray from character base position to -10 by Y axis from character base position - if collided, then the char is on ground). Edit....
- Wed Mar 23, 2011 11:30 am
- Forum: Beginners Help
- Topic: Animation not displayed/rendered?
- Replies: 2
- Views: 290
Animation not displayed/rendered?
So.. I imported a .X file which has a walk animation from frames 1-25. Whenever I press KEY_KEY_W I want the model to play the animation. This is the code I have currently. if( torsoNode ) { f32 frameNumber = torsoNode->getFrameNr(); if( frameNumber < 1 || frameNumber > 25) frameNumber = 1; torsoNod...
- Sun Mar 20, 2011 5:57 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 534
- Sun Mar 20, 2011 5:46 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 534
I tried to reproduce it, but I can't. It seems the problems root is deeper within my code.. :/
Here's what I'm basically doing, though. (pastebin links).
main.cpp
BugCulprit.h
BugCulprit.cpp
Here's what I'm basically doing, though. (pastebin links).
main.cpp
BugCulprit.h
BugCulprit.cpp
- Sun Mar 20, 2011 5:08 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 534
- Sun Mar 20, 2011 4:58 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 534
- Sun Mar 20, 2011 4:50 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 534
I've traced the error to these lines: vector3df rootPos = rootNode->getPosition(); camera->setTarget( rootPos ); camera->setPosition( rootPos + offset ); rootNode->setRotation( vector3df( 0, cameraDirection, 0 ) ); If I uncomment those lines of codes, then there's no graphical glitches. Btw, even if...
- Sun Mar 20, 2011 4:38 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 534
[Solved] Camera view messed up?
I'm trying to create a camera by writing this before the main loop.
ICameraSceneNode *cam;
cam = sceneManager->addCameraSceneNode();
It does create the camera.. however, the camera only displays half of the screen. The upper half is completely gray. Why is this so?
ICameraSceneNode *cam;
cam = sceneManager->addCameraSceneNode();
It does create the camera.. however, the camera only displays half of the screen. The upper half is completely gray. Why is this so?
- Fri Mar 18, 2011 6:03 pm
- Forum: Project Announcements
- Topic: irrBP - An Irrlicht - Bullet Physics Wrapper
- Replies: 200
- Views: 113059