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: 647
- Tue Sep 27, 2011 7:00 pm
- Forum: Advanced Help
- Topic: Mesh normals not changing or messed up after altering mesh?
- Replies: 3
- Views: 647
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 ...
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 ...
- Sun Sep 25, 2011 8:48 pm
- Forum: Beginners Help
- Topic: Raycasting not accurate after manually altering mesh?
- Replies: 2
- Views: 474
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: 474
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 ...
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 ...
- Wed Mar 23, 2011 1:12 pm
- Forum: Project Announcements
- Topic: TrollBrad [Free][RPG+RTS][WIP][TECHDEMO]
- Replies: 35
- Views: 16553
- Wed Mar 23, 2011 1:10 pm
- Forum: Beginners Help
- Topic: Animation not displayed/rendered?
- Replies: 2
- Views: 375
- Wed Mar 23, 2011 1:05 pm
- Forum: Project Announcements
- Topic: irrBP - An Irrlicht - Bullet Physics Wrapper
- Replies: 200
- Views: 192130
- Wed Mar 23, 2011 11:30 am
- Forum: Beginners Help
- Topic: Animation not displayed/rendered?
- Replies: 2
- Views: 375
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 ...
if( torsoNode )
{
f32 frameNumber = torsoNode->getFrameNr();
if( frameNumber < 1 || frameNumber > 25)
frameNumber = 1 ...
- Sun Mar 20, 2011 5:57 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 1031
- Sun Mar 20, 2011 5:46 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 1031
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: 1031
- Sun Mar 20, 2011 4:58 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 1031
- Sun Mar 20, 2011 4:50 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 1031
- Sun Mar 20, 2011 4:38 pm
- Forum: Beginners Help
- Topic: [Solved] Camera view messed up?
- Replies: 11
- Views: 1031
[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: 192130