- Home /
Vectrosity end caps Draw3D()
I would like to draw a 3D line with end caps (looking like an arrow) in space. After reading the documentation I thought this code should be exactly what I need:
VectorLine.SetCamera(Camera.main);
VectorLine.SetEndCap("Arrow", EndCap.Both, LineMaterial, FrontTex, BackTex);
Vector3[] points = new Vector3[]{Vector3.zero, velocity};
VectorLine arrowLine = new VectorLine("ArrowLine", points, LineMaterial, 20f);
arrowLine.endCap = "Arrow";
arrowLine.Draw3D(source.transform);
That works perfect in 2D but in 3D the caps are angled (image attached). I'm also using the same VectorLineColors material and arrow textures as used in the VectrosityDemos package.
How could I achieve to draw a nice arrow in 3D?
Answer by Eric5h5 · Aug 12, 2013 at 03:55 PM
Vectrosity is designed to draw lines that are facing the camera. If the 3D line is directly perpendicular to the camera, then the ends won't be bent like that.
Thank you eric! I created a second cam above looking straight down, passed it to SetCamera and everything is working.
Your answer
Follow this Question
Related Questions
3D Lines not facing camera 1 Answer
Path drawing script giving error 0 Answers
How to add Colider to Vectrosity? 0 Answers
Vectrosity Grid of Lines - coming out as diagonal converging at a point 0 Answers
Moving graph using vectrosity 1 Answer