XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : Point 3 value into Particle Matrix?

04-14-2009, 05:19 PM
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....

(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])

What have I missed?

04-14-2009, 06:47 PM
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.

$Teapot01.transform.row4 = [10.0,20.0,30.0]WORKS
myTransform = $Teapot01.transform
myTransform.row4 = [10.0,20.0,30.0]
$Teapot01.transform = myTransform
- Enrico

04-15-2009, 07:43 PM
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


CGTalk Moderation
04-15-2009, 07:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.