Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
0
Question by TornadeVent · Aug 27, 2018 at 02:08 AM · 3dvector3axis4dhypercube

How to position an object using the w axis from Vector4?

Hey. I have been strugling with this doubt for a while now, and I just can't figure it out.

I'm trying to make a hypercube (also called Tesseract), but I'm having trouble with represanting the w axis in the 3D space. For now, I have a cube that I made using Vector3 vertices (represented as spheres) and a line renderer to connect those vertices.

Now, in order to make the hypercube, I doubled those vertices and changed their object type to Vector4. Now, here's where I'm stuck. I realized that, when I instentiate the vertices, their positioning is being set using only the x, y and z axes. So the new vertices are being created over the other vertices and I just can't figure a way to make Unity consider the w axis.

I know that it's actually impossible to visualize a 4D space, but it's actually possible to kind of "emulate" it in a 3D space. So, should I be using another method? Maybe matrices instead of the Vector3 and 4? Any ideas and help is welcome. Thanks!

Sorry for any misinterpretation, English isn't my best language. Thanks!

Comment
Add comment · Show 5
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 misher · Aug 27, 2018 at 09:22 AM 0
Share

I'm not a math guy, but I suppose you may want to define your hypercube as an actual 4d object, u may use custom Vector4 to define vertices. Next stem would be figure out the way to "visualize" your cube in 3d space. Now in 3d space you can't use Vector4 to rappresent vertices but only Vector3. There should be some ready mathematics of how to project 4d object into 3d space, you need to code this "math" so for every given hypercube data input (Vector3, Edges) you get 3d figure data in output (Vector3, Edges, Faces).

avatar image JVene misher · Aug 27, 2018 at 11:19 AM 1
Share

You're right that there are means of projecting 4D spaces onto 3D spaces, which Unity would then 'understand' well enough to project onto a 2D display. However, as a consumer of math (not a mathematician of merit), I can say that a Vector4 only resembles a quaternion in the 4 parameters, they are otherwise unrelated. There is an entire algebra associated with quaternions that is entirely separate and with completely unrelated purposes than vectors of 4 parameters (and there are vectors, in pure math study, of more parameters than 4). The basic underlying math of Vector4 is highly related to the math of Vector3, just with more columns or rows when applied to matrices of similar dimensions.

avatar image Bunny83 JVene · Aug 27, 2018 at 02:21 PM 0
Share

Absolutely right ^^. I was about to mention the same thing. A 4 dimensional euclidean vector is something entirely different from a Quaternion. Quaternions are used to represent rotations or positions in 3d space only. They are represented by a 4 dimensional complex number. Though it can't be use to represent a point in 4d. At least all operations you can do with a quaternion wouldn't make any sense in 4d.


Note that when using Vector4 to represent a 4d point and using a 4x4 matrix to do all transformations you can't perform translations with such a matrix. A matrix transformation can only perform linear transformations on the input vector. So only scaling, rotating and other multiplicative operations (like shear) is possible. We use homogeneous coordindates to be able to perform translations with matricies. Though this always requires one dimension more than your actual spatial dimensions. So to do translations with matrices in 4d you would need a 5x5 matrix and would use Vector5 values. Though these doesn't exist in Unity. $$anonymous$$ost tesseract simulations use a fixed perspective projection around the origin and the 4d hypercube is located at the origin so no translation is needed.


I recommend to watch this computerphile video on matrices

Show more comments
avatar image Glurth · Aug 27, 2018 at 02:41 PM 0
Share

It's weird I know.. but Just to throw it out there: the fourth dimension need only be orthogonal to the other dimension. This includes TI$$anonymous$$$$anonymous$$ So, a regular cube, that appears at a particular time (position.w), then disappears after a particular time interval (lossyScale.W), COULD be considered a hypercube.
If you need to ANI$$anonymous$$ATE your hypercube, obviously you cannot ALSO use time as one of your hyper-cubes dimension (they would not be orthogonal): there are actually 5 dimensions required for this if we include time!

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by JVene · Aug 27, 2018 at 11:16 AM

If you've ever studied how 3D space is projected onto a 2D display, you would realize this can't be done by simply stabbing at the problem with a guess. This is a projection. Search the 'net for "how to project 4 dimensional space onto 3 dimensional space" to find a number of references on the math to do this. Once you find that it will become much clearer, but you must understand that describing all that's involved is in fact quite a blog, and won't fit within the limits of a post here. It is a studied subject, and there are some relatively standard approaches within a range of options, just as you find in 3D projections (where various cameras and perspectives are available).

Comment
Add comment · Share
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

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.

Follow this Question

Answers Answers and Comments

123 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotate GameObject 90 degrees where is my flaw? 0 Answers

Detecting Rays from controller input and cast from Object 0 Answers

GameObject doesn't move 1 Answer

Using a directional vector to orient a sphere? 0 Answers

How to add height to an aiming system (JS) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges