PDA

View Full Version : how do i step rotations in instances?



04-10-2012, 03:37 AM
Hi

I am having a problem with instances. I am trying to instance a curb with a bunch of curb stones. I had planned to randomly rotate them in 90 degree steps (like i used to do with HD instance) but there is no stepping input. I cant see anything in the nodal elements either that might assist this.

Does anyone have any sugestions as to how i can get them to rotate by multiples of 90?

Thanks

Nick

Axis3d
04-10-2012, 08:23 AM
Perhaps you could model your curb by beveling in the edge. This gives you an option of Edge Alignment in your Rotation tab.

I too hope that Newtek will incorporate the 90 degree step increments that HD instance has.

dpont
04-10-2012, 09:17 AM
Connect the Instance ID (Instance Info node)
in the A input of a Math Scalar node, set B to 4,
so for your Instance sequence you will get 0, 1, 2 or 3,
multiply by a Constant Angle node set to 90,
it converts this angle to radian which is the correct
unit for the node editor, you get 0, 90, 180 or 270 angles
for your sequence, connect this result in the X Input
of a Make Vector node (Heading), plug it in Rotation.

You could skip the Math Mod node, just multiplying
the Angle by the Instance ID but not sure with
a huge number of instances, when you reach great
angle values.

Denis.

adk
04-10-2012, 07:36 PM
Hi there Denis,

I've tried this setup that you describe but for some reason it only works for me with native LW Instancing & not DP Instancer. I've tested & re-tested and for the life of me can not find why this doesn't work as you describe.

x32 using latest versions of your plugins & included the scene file below.
Not sure that I've ever seen a lock icon next to any of the plugins like this ? What the heck would that mean ? Could that have something to do with perhaps ?

Cheers.

dpont
04-11-2012, 12:58 AM
...I've tried this setup that you describe but for some reason it only works for me with native LW Instancing & not DP Instancer...

Yes the DPI Instance Info node was broken in the node editor context,
this has been fixed in the win32 version yet.

Denis.

adk
04-11-2012, 03:43 AM
Cheers a bunch for the fix & the update Denis :thumbsup:

04-17-2012, 04:53 AM
Connect the Instance ID (Instance Info node)
in the A input of a Math Scalar node, set B to 4,
so for your Instance sequence you will get 0, 1, 2 or 3,
multiply by a Constant Angle node set to 90,
it converts this angle to radian which is the correct
unit for the node editor, you get 0, 90, 180 or 270 angles
for your sequence, connect this result in the X Input
of a Make Vector node (Heading), plug it in Rotation.

You could skip the Math Mod node, just multiplying
the Angle by the Instance ID but not sure with
a huge number of instances, when you reach great
angle values.

Denis.

Thanks Denis,

I had tried something similar but was multiplying by an integer rather than the fixed angle so it wasnt getting converted to radiens. I finished up using a couple of random integer generators to give a little more variation across the different chanels.

All working fine now :)

mystick
06-19-2012, 10:30 PM
this way works
105184
105183
but step option MUST BE included in instancer

06-20-2012, 03:20 AM
As an adendum. Following Denis's instructions i got the stepped rotations i was after but LW didnt like to render the instances correctly. it was botching up the shadows in the SubD.

The fix was to save transforms of my objects rotated by 90deg steps and instance those (without using nodes). then they rendered correctly.

I have tried to recreate this in a smaller scene for fogbug but it works just fine when stripped out of the scene on its own without all the other instancing that was going on. Only two of my instances failed like this (with SubD rendering issues) both of them needed stepped rotations and had been rotated via nodes. both worked fine when i removed the nodes. :(

as soon as i can find time i'll try and recreate the error in a small scene