• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Morden · Sep 02, 2014 at 05:14 AM · vector math

Vector math: When forward,up,and right are certain values, a part of my model is at (0,1,0). How do I calculate that?

I know that when my object is sitting in a certain way, a specific part is on the (0,1,0) vector. I know what all 3 transform vectors (forward, right, and up) are at that given time. Knowing these 4 vectors at that specific time, it seems to me that I should be able to do some sort of vector math such that I can determine the vector for that specific part at any given time. So if I draw a ray during Update, I can have it ALWAYS pass through the specific point on my model (ignoring rounding errors). But I can't work it out.

Is it possible, or is there some sort of flaw in my logic?

For specifics, I know that when the three axes are:

forward: (0.873,-0.333,0.356)

right: (-0.172,0.471,0.865)

up: (-0.456,-0.816,0.354)

the vector I need to aim down is (0, 1, 0).

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rutter · Sep 02, 2014 at 05:13 AM 0
Share

How do you know which point you need to connect to?

At a glance, it seems to me that TransformPoint might be the way to go. You could use it to build a Ray that begins at the pivot point and travels through your target.

avatar image Morden · Sep 02, 2014 at 05:36 AM 0
Share

I just know by looking at the model. The particular example I am using is a 4-sided die. When the die sits flat on one side, a particular corner is straight up.

I had a really long comment about not knowing what to transform by and that maybe my problem was working in world space ins$$anonymous$$d of object space. Then I looked up doing that conversion and realized that's what TransformPoint was for. I'll look into using that and see what I come up with.

avatar image Morden · Sep 02, 2014 at 06:05 AM 0
Share

That did it, thanks. $$anonymous$$y ray is now firing out exactly where it is supposed to, regardless of the object orientation.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Vector math problem 1 Answer

Getting a ball to bounce in fixed angle 1 Answer

Moving a gameobject on a certain direction 1 Answer

Take my useful script - but help me improve it? 2 Answers

Determining if something is on the Left or Right of an Object 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges