Unity Community


Page 51 of 121 FirstFirst ... 41495051525361101 ... LastLast
Results 1,001 to 1,020 of 2411
  1. Yeah, bummer. I can watch the points while the game is running and there's no movement. Hmm.

    I guess my issue is that in my final setup, the two middle points of the line will almost always be in motion, so they pretty well need to be updated continuously.

  2. Volunteer Moderator
    Posts
    23,726
    Quote Originally Posted by Clockworkservant View Post
    Yeah, bummer. I can watch the points while the game is running and there's no movement. Hmm.
    There kind of has to be, if the texture is changing. Probably the perspective changes involved in moving the camera changes the screen space length of the lines. (Since the texture scale calculations are based on screen space.)

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes

  3. Yes, okay I see what you mean. If you're calculating it based on screen space (and I guess I read that at some point) then it makes sense. I guess it's not exactly made for a situation with this much ambient camera motion


  4. Posts
    5
    Hello, I like drawing free surfaces using the mouse and when I finish I clik on the surface entry will display help me and give me the correct code

  5. Volunteer Moderator
    Posts
    23,726
    Sorry, I couldn't understand that at all.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  6. Posts
    5
    I have to draw a free surface in 3D of course unity with the mouse and when I finish I CLIKE grafted on the surface appears


  7. Location
    Chapel Hill, NC
    Posts
    121

    Trouble with 3d lines

    Eric

    I have an odd problem that I need some help with.

    1) In the first attachment (3dLinesGood.jpg) you will see some lines connecting some spheres. These lines were created with vectrocity in 3d and they look fine as you can see.

    2) In the second attachment (3dLinesBad.jpg) you will see a graph created with 2d vectrocity lines with the 3d image "behind" it. As you can see, the 3d lines go haywire.

    Do you have any idea what is going on here? Once the graph (2d lines) is displayed, the 3d lines dont work. If I never display the graph the 3d lines look fine. This is quite repeatable.

    Thanks
    Attached Images   

  8. Volunteer Moderator
    Posts
    23,726
    Quote Originally Posted by mohamed20 View Post
    I have to draw a free surface in 3D of course unity with the mouse and when I finish I CLIKE grafted on the surface appears
    Can you get someone who knows some English to help you write your question, because I'm afraid I just don't understand what you're trying to say.

    Quote Originally Posted by trobertson View Post
    Do you have any idea what is going on here? Once the graph (2d lines) is displayed, the 3d lines dont work. If I never display the graph the 3d lines look fine. This is quite repeatable.
    That is weird. I did a quick test here where I draw a 3D line then wait a bit and draw a 2D line, and there aren't any issues like that. Can you send me the project?

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  9. Location
    Chapel Hill, NC
    Posts
    121
    Eric,

    Regarding the 3d lines problem, can you try your quick test the other way around? Draw the 2d lines, then 3d. If this does not repeat the problem, I'll see about sending you a contained project.

    Thanks!

  10. Volunteer Moderator
    Posts
    23,726
    Still works fine the other way around.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  11. Location
    Chapel Hill, NC
    Posts
    121
    Eric

    I sent a condensed project to your Starscenes email account. Thanks

    Tom


  12. Location
    Curitiba - PR / Brazil
    Posts
    275
    Hello there!

    I'm trying to do one simple thing!

    Exactly like Flight Control, but with some distance travel limmiter, you can only draw like a 1000 pixes.

    But the problem start with this, I'm using the DrawLinesTouch example, but porting to C#, here is what i get:


    Code:  
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5. public class GameplayManager : MonoBehaviour
    6. {
    7.    
    8.     public Airplane         airMain;
    9.     public Material         matLine;
    10.    
    11.     private float           fLineWidth = 3f;
    12.    
    13.     private float           fMaxDist = 1000;
    14.    
    15.     private Vector3         v2PrevMouse;
    16.     private Vector2[]       arrLinePoints;
    17.     private VectorLine      linePath;
    18.     private int             iLineIndex;
    19.     private float           fDistCount = 0;
    20.     private int             sqrMinPixelMove = 5*5;
    21.     private bool            bPress;
    22.    
    23.  
    24.     // Use this for initialization
    25.     void Start ()
    26.     {
    27.        
    28.         arrLinePoints = new Vector2[1000];
    29.         linePath = new VectorLine("DrawnLine", arrLinePoints, matLine, fLineWidth, LineType.Discrete);
    30.    
    31.     }
    32.    
    33.    
    34.    
    35.     private void StartDrawMouse()
    36.     {
    37.         Vector.ZeroPointsInLine(linePath);
    38.         linePath.minDrawIndex   = 0;
    39.         linePath.maxDrawIndex   = 1;
    40.         iLineIndex              = 0;
    41.         fDistCount              = 0;
    42.        
    43.         arrLinePoints[0]        = Input.mousePosition;
    44.        
    45.        
    46.         bPress                  = true;
    47.     }
    48.     private void StopDrawMouse()
    49.     {
    50.         bPress = false;
    51.     }
    52.    
    53.     private void Record()
    54.     {
    55.         if(fDistCount < fMaxDist)
    56.         {
    57.             if(Vector3.Distance(Input.mousePosition, v2PrevMouse) > 10f)
    58.             {
    59.  
    60.                 fDistCount                  += Vector3.Distance(Input.mousePosition, v2PrevMouse);
    61.                 arrLinePoints[iLineIndex]   = Input.mousePosition;
    62.                
    63.                 linePath.minDrawIndex       = iLineIndex-1;
    64.                 linePath.maxDrawIndex       = iLineIndex;
    65.                
    66.                
    67.                
    68.                
    69.                 iLineIndex++;
    70.                 v2PrevMouse                 = Input.mousePosition;
    71.             }
    72.         }
    73.         else
    74.         {
    75.             StopDrawMouse();
    76.         }
    77.     }
    78.    
    79.     // Update is called once per frame
    80.     void Update ()
    81.     {
    82.         Vector.DrawLine(linePath);
    83.         if(bPress)
    84.             Record();
    85.        
    86.        
    87.         if(Input.GetMouseButtonDown(0))
    88.         {
    89.             if(airMain.myStatus == Airplane.Status.AVALIABLE)
    90.             {
    91.                 StartDrawMouse();
    92.             }
    93.         }
    94.         else if(Input.GetMouseButtonUp(0))
    95.         {
    96.             StopDrawMouse();
    97.         }
    98.    
    99.     }
    100. }

    But every new click i get some strange point from 0,0! Look at this video:



    Someone can help me?

  13. Volunteer Moderator
    Posts
    23,726
    Since you're using a discrete line, you should wait until there are at least two points before drawing anything. Otherwise it's connecting the first point with Vector2.zero.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  14. Location
    Curitiba - PR / Brazil
    Posts
    275
    Quote Originally Posted by Eric5h5 View Post
    Since you're using a discrete line, you should wait until there are at least two points before drawing anything. Otherwise it's connecting the first point with Vector2.zero.

    --Eric
    Hum..

    Looks so simple now you tell me! hahaha just to the record:

    Just this save the work:
    Code:  
    1. if(iLineIndex > 1)
    2.             Vector.DrawLine(linePath);
    Last edited by badawe; 04-03-2012 at 01:04 PM.


  15. Location
    Sydney, Australia
    Posts
    296
    I've got an issue where I'm drawing two separate lines, but using instances of the same material, and are having Vector.SetTextureScale(line, 1f); called. This call is causing the first line to lose it's texture scale information and become stretched again.

    Would you have any immediate ideas on why this might be happening?

  16. Volunteer Moderator
    Posts
    23,726
    Are you changing the material scaling yourself somewhere? SetTextureScale only changes the UVs of the line that's passed into that function, it doesn't actually touch the material or texture at all.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  17. Location
    Lafayette
    Posts
    6
    Hey hi Eric,

    Can i attach this 3D line as term of vector to my car body . The dimension and direction of this line should change as my car is moving in particular direction. Is that possible ?.
    I have physics formulas and i want to attach lines to the center of gravity of the car. Those lines are velocity and acceleration components.

    Please let me know.

    Thank You
    Pinkesh

  18. Volunteer Moderator
    Posts
    23,726
    That's related to this topic, I see. Vectrosity doesn't currently have support for arrows at the ends of lines like that, so I don't think it would quite work for your particular case.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  19. Posts
    586
    Hello again, Eric, I've got question about adding colliders to vector lines. I'm attempting to build an erase tool by finding all vector objects in range of my cursor using a sphere collider on the cursor and then iterating the line arrays of all hit vector lines but I'm not sure how to add colliders to the lines. Can I do this at runtime? Should I add box colliders or mesh colliders? To the vector line or vector object?

  20. Volunteer Moderator
    Posts
    23,726
    I'm not sure adding colliders would be the best way. I'd suggesting iterating through all the points and checking the distance. (Using the (a-b).sqrMagnitude technique would be a little faster than Distance, which is the same as (a-b).magnitude and uses a square root.) Unless you have a really huge number of points, the performance should be OK. If not, there are other techniques for optimization that would be better than adding tons of colliders.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes

Page 51 of 121 FirstFirst ... 41495051525361101 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •