- Home /
Vectrosity 3D line redraw on camera move
Hi Eric and all Vectrosity users!
I'm starting to play with Vectrosity and wanted to implement a very simple scenario: draw a textured 3D line (with VectorLineGlow material) and face it correctly to the main camera when the latter moves and rotates. Here is the initial scene state:
The camera looks on the black square with Vectrosity line drawn on top of it with a small offset. The following code is executed inside Start()
:
line = new VectorLine("Square",
new[] { bottomLeft, bottomRight, topRight, topLeft, bottomLeft },
LineColor, LineMaterial, 20, LineType.Continuous, Joins.Weld);
line.Draw3DAuto();
When I move the camera I see the following strange effect:
I see that the line is bound to the correct camera (when I move other cameras the line remains intact), but line behavior looks so strange that I can not even think of possible cause and how to fix it.
Answer by demid · Aug 17, 2014 at 06:14 PM
There is a workaround to achieve visually the same line setup:
var line = new VectorLine("Square", new[]
{
topMiddle, topLeft,
topLeft, middleLeft,
bottomMiddle, bottomRight,
bottomRight, middleRight,
bottomMiddle, bottomLeft,
bottomLeft, middleLeft,
topMiddle, topRight,
topRight, middleRight
}, LineColor, LineMaterial, 20, LineType.Discrete, Joins.Weld);
line.Draw3DAuto();
However, this is not easy to find correct line pieces this way all the time, so a more elegant approach is still welcome.
Your answer
Follow this Question
Related Questions
Vectrosity 3D Line facing Vector3.up 1 Answer
Line problem 0 Answers
Vectrosity mouse draw line collider 0 Answers
Are there any 'ghost-like'/smokey shaders for a line material? 0 Answers
How to draw a line in unity3d 3 Answers