x


3D Polygons

I'm trying to recreate some polygon shapes in 3D using primitive capsule shapes basically using the y scaling factor to specify the line segment length. I'm trying this:

var capsule : GameObject = GameObject.CreatePrimitive(PrimitiveType.Capsule);
capsule.transform.position = Vector3(0,0,0);
capsule.transform.localScale = Vector3(.1, 5, .1);

var capsule2 : GameObject = GameObject.CreatePrimitive(PrimitiveType.Capsule);
capsule2.transform.position = Vector3(0,0,0);
capsule2.transform.localScale = Vector3(.1, 5, .1);
capsule2.transform.Rotate(0, 0, 45);
// what translation would move the bottom of this shape to the top of the first?

but can't figure out how to determine the correct translation I need to move the bottom of the second shape to the top of the first.

It seems that if there was a routine that would take a "from" and "to" Vector3 and returned a transform that would property project from to to, that's what I need, but I can't find that.

Maybe there is a better approach?

more ▼

asked Dec 25 '11 at 10:13 PM

monkeyThunk gravatar image

monkeyThunk
66 4 6 7

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x50
x13

asked: Dec 25 '11 at 10:13 PM

Seen: 319 times

Last Updated: Dec 25 '11 at 10:13 PM