How to get The up-vector of a primitive?

   25295   23   2
User Avatar
Member
2199 posts
Joined: July 2005
Online
I may not be 100% following what you are asking here, but if you need an “up-vector” to always be positive in the y-axis can't you just test if the y component of the prim normal is positive and if it isn't then reverse it?
I haven't really thought about this too hard as I've never needed to do it so I could be wrong, but that was my first thought…..

Oh and if you want something to always be up with reference to another vector just take the dot product and flip when it turns negative.
The trick is finding just the right hammer for every screw
User Avatar
Member
23 posts
Joined: July 2005
Offline
Hi, Simon. just thinking alloud.

It was not a request to start re-wiring your OTL, i think i should really start to get into that matrix VEX myself and your otl is a good place to start.

I thought i anwsered mine initial question about a manner to get a up-vector that lies in the plane of the primitive, makes an angle of 90 degrees with the normal (Parallel with the y-axis~ that could be used as a “local” axis system thingy) i'm not good at explaining

The idea is that, on SOP level, the position of geometry before you it align to the primitive of another piece geometry , can though of to be as “up” in regard to the y-axis, so that after alignment no manual adjust ment is necessary to retain the “up” orientation of the geometry.

for example the procedual placements of a large number of ornaments on the exterieur or interieur a building (even with slanting walls).

I noticed that the translate was not connected. You called the OTL Orient so maybe you could leave translation up to the user( and use the translate part for an offset translation)
User Avatar
Member
2199 posts
Joined: July 2005
Online
Damn, I could have sworn I tested that. Sorry the output from the add_translation vop should be wired into the first input of align_with_primB instead of the output from align_with_origin. That way when you add a translation you are using the local axis of the prim you align too. This would be difficult for the user to add afterwards. Thanks for spotting that, I'll update the exchange version (again!)
The thing with the method I use is the normals from the two prims once aligned will always be pointing the same way. So if you want stuff always on the outside make sure all your prim normals are pointing outwards and then make flip being on the default.
The trick is finding just the right hammer for every screw
User Avatar
Member
23 posts
Joined: July 2005
Offline
Cool.

I followed your instructions and the offset translation is working.
  • Quick Links