Mogre RenderOperation OT_LINE_STRIP not always drawn

questore

20-06-2012 10:23:33

Hi guys!
I was working on Mogre Intermediate tutorial 4 and everything is fine except:
The object selection always done right, but the selection linestrip not always drawn on screen depends on what angle im looking with camera.
Not drawn lines example:

mCamera.Position = new Vector3(500, 500, 500);
mCamera.LookAt(new Vector3(-1000, 200, -50));
mCamera.NearClipDistance = 0.1f;
mCamera.FarClipDistance = 50000;

A Help would be really apreciated.

Tubulii

20-06-2012 20:23:17

Have you tried to move the camera manually (mCameramgr.Freeze = false)?
Mabye its hidden because you are to fare away and the line to small (1px)? Fly around with the camera and check if it really disappears.

questore

21-06-2012 12:36:59

Have you tried to move the camera manually (mCameramgr.Freeze = false)?
Mabye its hidden because you are to fare away and the line to small (1px)? Fly around with the camera and check if it really disappears.

Not worked but i dont move the camera position.
I begin to draw a line in an area where i can see it, then i turn the camera about 1 radian left or right or down or up and the rectangle disappears, but when I turn the camera back, all the line appears.
This happens all 4 direction if I pass a certain line in the turning (every time same coordinates)
Like i can only seeing the drawn lines when my camera is looking at a certain area.
So the rectangle is still not drawn. Try the tutorial and positon the camera where I have, look in that direction and tell me what is wrong please.

dnagreen

06-11-2012 22:40:25

I have this issue too, but in OGRE c++. I think the issue has something to do with culling. When using the tutorial and this line to create the selectionbox

mSceneMgr->getRootSceneNode()->createChildSceneNode("SelectionNode")->attachObject(selectionBox);
I run into the issue that every time my camera moves such that 0,0,0 is out of view, my lines wont draw to the screen. I think this is because they are attached to the object located at 0,0,0 so when that object is called, so is the children?

Tubulii

07-11-2012 13:55:04

Culling can be turned off using "cull_software none" and "cull_hardware none".

I think this is because they are attached to the object located at 0,0,0 so when that object is called, so is the children?
Sorry, but I don't understand your question.

Beauty

11-11-2012 20:56:58

I suppose you use OT_LINE_STRIP with ManualObject.

Mabye its hidden because you are to fare away and the line to small (1px)?
Lines of ManualObjects are very nice. Independent of the distance they are always visible (with 1px width).
By the way: It's possible to change the with by the PointSize in the used material.
More details I published on the wiki page ManualObject.

Fly around with the camera and check if it really disappears.
In the past I had the problem that a line was invisible, because it was pointing directly to the camera.
To fly around with the cam should help to figure out that case.

Perhaps there is no light?
In this case you can't see a line. (Exception: It's a light source itself.)

For testing you could add 2 triangles to the same ManualObject, which contains the same coordinates.
When it's done: Do you see the triangles surface?

Can you post your code which you use to create the ManualObject?

I have this issue too, but in OGRE c++.
dnagreen, nice to see you here and thanks for your note.
Interesting to know that it seems to be a common issue.

One more idea:
Try to use OT_LINE_LIST instead of OT_LINE_STRIP.
When you change the code, don't forget to add 2 points for each line.
Maybe it solves the problem?