[Closed] Point 3 value into Particle Matrix?
I need to store a Point 3 value but my ParticleVector channel is being used. How can I put a point 3 value into the ParticleMatrix channel for re-calling later?
pCont.particleIndex = i
pCont.ParticleMatrix.row1 = pCont.ParticlePosition
print pCont.ParticlePosition
print pCont.ParticleMatrix
Gives me…
[-32.6154,39.168,5.4221]
(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])
What have I missed?
Hi Dave,
not sure if particles make the same case as objects, but in MaxScript Reference, under ‘Matrix3’ you got this note:
When working with object transformation matrix3 values, the rows and their sub-elements cannot be modified directly. To change a row or an element of the row, assign the matrix3 value to a user variable first, modify the matrix3 rows by assigning to the variable and then assign the variable back to the .transform property of the original object.
[B]DOES NOTHING[/B] $Teapot01.transform.row4 = [10.0,20.0,30.0]
[B]WORKS[/B] myTransform = $Teapot01.transform myTransform.row4 = [10.0,20.0,30.0] $Teapot01.transform = myTransform
- Enrico
Cheers, Bobo pointed me towards the same bit of the help file… lesson learned… read propperly…
Trying to get my head around the matrix and how it works, currently trying to link particles to a dummy, got the rotation working but not the position…
I’ve attached a demo scene, with a box linked showing the motion I want to achieve,
on ChannelsUsed pCont do
(
pCont.useage = true
pCont.useMatrix = true
pCont.useTM = true
)
on Init pCont do
(
)
on Proceed pCont do
(
count = pCont.NumParticles()
for i in 1 to count do
(
pCont.particleIndex = i
if pCont.particleAge == 0 then
(
--store original transformation matrix
pCont.particleMatrix = PCont.particleTM
)
new_tm = ($Point01.transform * pCont.particleMatrix)
pCont.particleTM = new_tm
)
)
on Release pCont do
(
)