Posts: 9
Threads: 3
%%TYL_NUMTHANKEDLIKED%%
Joined: Mar 2013
Reputation:
0
Hi,
How can I create a line with fixed width, which will not change when I move the camera? I do not want my lines to scale up when I move the camera away.
I have tried using Ab3d.Visuals.LineArcVisual3D and Ab3d.Models.Line3DFactory.CreateLine3D(), but the result was the same.
I think Ab3d.Utilities.LinesUpdater.Instance.UnregisterLine() might do the work, but I can't get it to work properly.
Any hints?
Posts: 566
Threads: 8
%%TYL_NUMTHANKEDLIKED%%
Joined: Sep 2009
Reputation:
7
You can create a 3D plane with PlaneVisual3D or PlaneMesh3D - you can than set Size to something that would look like a line - for example (3, 500).
I hope this is what you are looking for.
Andrej Benedik
Posts: 566
Threads: 8
%%TYL_NUMTHANKEDLIKED%%
Joined: Sep 2009
Reputation:
7
I understand now.
You can achieve that with the following:
- first you need to disable LinesUpdater - this can be done in the class constructor with:
Ab3d.Utilities.LinesUpdater.Instance.UpdateMode = Ab3d.Common.Utilities.LinesUpdaterMode.Never;
- than after you added your 3D lines you need to manually refresh the camera and LinesUpdater. For example if you have defined your lines in XAML, than you can add the following code to OnLoad event handler:
Camera1.Refresh();
Ab3d.Utilities.LinesUpdater.Instance.Refresh();
Note that this will not work if called from constructor - you need to call this after (or in) Loaded event.
I hope that this is what you are looking for - note that if the camera will be changed after that the lines will look strange - they are created for specific camera angle.
Andrej Benedik
Posts: 9
Threads: 3
%%TYL_NUMTHANKEDLIKED%%
Joined: Mar 2013
Reputation:
0
Is there any other solution, which does not require creating a window and displaying it (so the Loaded event fires)?
I have tried inheriting LineVisual3D to expose CreateModel() method, but calling it creates model geometry with NaN position values.
Posts: 9
Threads: 3
%%TYL_NUMTHANKEDLIKED%%
Joined: Mar 2013
Reputation:
0
Hi, that is exactly what I was looking for. Thanks for help.