Professional Web Applications Themes

3D Draw Line? - Macromedia Director 3D

Hi, I'm very new to 3D so I'm not sure if this is basic or not. I've created 2D hierarchical tree-structures in the past in using flash and I'm basically trying to do the same in 3D in Director. I'm trying to use real 3D models through lingo rather than using 3D References and quickLines. So my question is...If i create two models (spheres) and place them in a 3D Scene, how can I generate a connecting line between them? I would like to be able to change this lines thickness.My preference would be to use a cylinder (model) but ...

  1. #1

    Default 3D Draw Line?

    Hi,
    I'm very new to 3D so I'm not sure if this is basic or not.
    I've created 2D hierarchical tree-structures in the past in using flash and
    I'm basically trying to do the same in 3D in Director. I'm trying to use real
    3D models through lingo rather than using 3D References and quickLines. So my
    question is...If i create two models (spheres) and place them in a 3D Scene,
    how can I generate a connecting line between them?
    I would like to be able to change this lines thickness.My preference would be
    to use a cylinder (model) but I'm unsure how to transform it to the correct
    location and rotation. Anyone got any suggestions?
    Thanks
    Connor

    connoru Guest

  2. #2

    Default Re: 3D Draw Line?

    Hello connor.

    While reading your question I also thought of a cylinder as a sulotion to this
    problem.
    Well, when you create a primitiv using Lingo, you CAN modify its properties,
    by changing the model resource properties.

    For example:

    cyl= member("3D").newModelResource("cylinder01-resource", #cylinder)
    creates a new cylinder model resource.

    now you should add it to the 3D world:

    member("3D").newModel("cylinder01", cyl)

    then you can modify its properties, such as height, bottomRadius, topRadius
    etc.

    now, as for locating the models as you want them to be:
    each model has a transform object (if it is indeed an object, and please
    currect me if i'm wrong) which you can access using simple modelName.transform,
    the trasnform object contains information of the model's current
    transformation (scale, position, rotation).

    say for example that you have 2 spheres models: sphere1 and sphere2., and you
    want to draw a line bitween them.
    sphere1 is located in position (0,0,0) and sphere2 is in (0,100,100)

    First, you put the cylinder where the first sphere (sphere1) is (using the
    transform object) then, you make the cylinder point at sphere2 (using the
    pointAt method), then you mesure the distance bitween the 2 spheres (using the
    distanceTo vector method), and the last thing you do is to set the cylinder's
    height to the same value as the distance.

    I'm quite sure that'll do.
    bgsBS

    bgsBS Guest

  3. #3

    Default Re: 3D Draw Line?

    :D
    That worked a treat. Dunno how I missed the pointAt property.
    Now I can plough on. Thanks a million.
    C
    connoru Guest

  4. #4

    Default Re: 3D Draw Line?

    i have to add another method here, because it draws just a line between two
    points. and it needs less code.

    example:


    then you have to give the one-polygon-model a toon modifier and set the
    renderstyle to point. thats all.

    gruss!
    (i posted this some time ago, and was not able to find it with the
    forum-search, i found it with the google-groups search.)

    hondo3000 Guest

Similar Threads

  1. draw line on top of bitmap
    By finecur in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: May 23rd, 05:21 AM
  2. Draw line using Acrobat SDK
    By Madhav@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 18
    Last Post: November 25th, 12:26 PM
  3. draw line as a Component
    By ST in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: March 12th, 06:41 AM
  4. draw a line
    By hondo3000 webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 2
    Last Post: January 20th, 02:28 PM
  5. How to draw lines with different line width?
    By Yi Chu in forum PERL Beginners
    Replies: 3
    Last Post: October 3rd, 06:44 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139