4

annotation

I have two cubes (Cube1 and Cube2) and I am positioning an icosphere by adding the two vectors of the former cubes. I then scale the icosphere's vector by 0.5 so that it sits visually between the two cubes.

What I really want is for it to sit between the two cubes on the green vector so that I can move it between the two cubes. I noticed that the icosphere moves on its local axis rather than world axis.

I have read a lot about vectors and matrices etc. and still find it difficult to understand sometimes.

So my questions are, how would I get my icosphere to use the green vector for its position, and if possible explain why it only moves in local space rather than world space, and is it even possible to move it in world space so its pivot point moves with it?

Neil
  • 1,976
  • 5
  • 28
  • 42

2 Answers2

8

[Fun fact: every answer needs at least 30 characters. Markup symbols don't count.]

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
  • Interesting use of the mix node, didn't expect this – Neil Feb 18 '22 at 14:26
  • 1
    @Neil take a look at this answer by Marty Fouts, which effectively is a list of vector formulas you can replace with the Mix RGB node. – Markus von Broady Feb 18 '22 at 14:40
  • thanks, where would I find info on world v local space in GN? Do you usually move all the points instead of a whole object? Maybe I need to change my thinking. – Neil Feb 18 '22 at 14:54
  • 2
    FYI the character limit is there to enforce at least a bit of explanation if you post only a video. Some people with disabilities or with very slow internet connection have trouble with gifs :) – Gorgious Feb 18 '22 at 15:04
  • 2
    @Neil every vertex has a coordinate. Those coordinates, as well as connections between vertices (and some other attributes like smooth shading or material slot) define a mesh. An object is a wrapper of a mesh, that allows you to add stuff like rotation, scale, translation (location), parenting, constraints... matrix_world is the result transformation matrix that is applied to each vertex coordinate in order to evaluate the real coordinate. – Markus von Broady Feb 18 '22 at 17:06
  • @MarkusvonBroady thank you, so I think I get it now, the origin point stays where the object that you added your geo nodes tree to? So you only deal with the points, edges and faces etc. in local space? – Neil Feb 21 '22 at 16:57
  • 1
    @Neil correct, geometry nodes modify geometry. They have access to object properties, but can't modify it. position of the origin is an object property (location), so you can't modify it in geometry nodes. – Markus von Broady Feb 21 '22 at 17:04
2

I'm not entirely certain if this is what you wanted but this does what you described.

https://giant.gfycat.com/ScientificShockingCarpenterant.mp4

Here's the node tree

enter image description here

and if you want it to go 0-1 you can just put a map range

enter image description here

TheJeran
  • 2,601
  • 1
  • 8
  • 24
  • I guess this goes in the right direction. Although if I see it correctly, the scaling seems to be a bit weird... I understand the question like with scale 0 the icosphere should be at cube 1 for example, at scale 1 it should be at cube 2. So that the path between the cubes is always from 0 to 1 so that a scale of 0.5 is the exact center between those cubes. Right now it looks a bit different but I'm not sure. Unfortunately I have no time now to test it, but maybe my comment can help you tweaking your setup (if it's not already doing what I describe and I just didn't realize it). – Gordon Brinkmann Feb 18 '22 at 13:58
  • Just throw a map range in front if you want it between 0-1. I'll edit – TheJeran Feb 18 '22 at 14:08
  • Thank you, I'll take a look at this later. Would you be able to answer my question on local v world space also? – Neil Feb 18 '22 at 14:12