[bug?] extremely strange LoD behavior

ryak2002

17-10-2006 05:58:06

It's tough to describe, so i'll use screenshots. Basically, the detail texture blinks on and off depending on whether the robot is facing in the positive or negative x direction.

The problem goes away if i comment out the indicated line:

Vector3 src = mNode->getOrientation( ) * Vector3::UNIT_X;
src.y=0;
if ( (1.0f + src.dotProduct( mDirection )) < 0.0001f )
{
mNode->yaw( Degree(180) );
}
else
{
Ogre::Quaternion quat = src.getRotationTo( mDirection );
quat.normalise();
mNode->rotate( quat ); // <------ this line
} // else



Facing west:

Facing east:


Source:

http://rkellyspage.com/Documents/Interm ... %202.5.cpp

tuan kuranes

17-10-2006 07:29:14

That may just happens because distance between camera and terrain is greater.
you can change that in material file.

slunk731

17-10-2006 07:53:45

The camera isn't moving between the two screenshots, only the robot... and moving the camera around while it's in either state doesn't change the appearance.

tuan kuranes

17-10-2006 10:44:40

SDK or CVS ?

ryak2002

17-10-2006 21:25:12

sdk. Any other questions?

As slink said, the camera is in the exact same position for both those screenshots. Moving the camera had no effect on the oddity. It toggles every time the robot changes directions from +x to -x or -x to +x and only when the robot changes directions in that fashion.

Changing from a particular +x direction to a slightly different +x direction, it remains the same.

slunk731

24-10-2006 17:03:00

Is there anything we can give you that would give you a clue about what's going on here?

tuan kuranes

25-10-2006 12:33:13

still didn't found the time to reproduce the bug here, sorry.

slunk731

25-10-2006 17:15:36

Okay, sorry to bug you- I was just wondering if there was something we could do.

kungfoomasta

25-10-2006 17:42:34

Is there something underneath the mouse cursor?

Try posting any functions relating to the camera (creation, etc), terrain, and robot.

KungFooMasta

slunk731

29-10-2006 23:59:06

The above-linked file is the only one in the project source. Keep in mind that it extends OGRE's Example Framework, so anything not explicitly done is taken care of by the framework.

kungfoomasta

30-10-2006 04:07:16

Although the source may be in the link you posted, usually you get better results if you post code. The easier you make the problem known the faster you might receive a solution by anybody reading the thread. Or you can wait until Tuan downloads it... but he is pretty busy usually.

KungFooMasta

kungfoomasta

30-10-2006 04:26:10

I don't have access to Visual Studio at the moment (business trip), but I glanced at your code in my browser.

Basically (Correct me if I'm wrong):
1) Robot placed on terrain at specified position
2) Every Frame:
i) place camera x units above terrain (if camera is above terrain)
ii) place robot x units above terrain
iii) Turn/Walk towards first knot in path list (if list not empty)

Left Clicking places knots and populates path list.
Also switch between idle and walk animations.

The bad thing.... is that I didn't see anything pop out at me. :?

if you change the line:
mNode->rotate( quat )

to
mNode->yaw(Ogre::Radian(Ogre::Degree((Ogre::Real)180)));

Does the problem still occur?

Hope Tuan or others can help you out.

KungFooMasta