# Problem with applying Chunk pivot orientation to particles

THREAD CLOSED
 Thread Tools Search this Thread Display Modes
 05 May 2008 reForm Expert portfolio Patrick Macdonald CG Artist reForm Studios London, United Kingdom Problem with applying Chunk pivot orientation to particles I'm trying to use object-chunks pflow birth script but with the added joy of being able to retain the pivot orientation of the source mesh's within the particle. When pflow creates the chunks, the particle rotations are all [0 0 0] rather than the rotation that I have specified by rotating the mesh pivots. The script below is getting close to what I want but some objects are 180 degrees off of what they should be if I was to local-rotate the source objects. I assume its because I'm using euler and quat values when I need to use angleaxis values. Any ideas how I can fix the math to get the result I'm looking for? `````` on Proceed pCont do ( t = pCont.getTimeStart() as float if t > 0 do ( NumChunks = ChunksArray.count tt = ((t/160)) if tt < NumChunks do ( pCont.AddParticle() pCont.particleIndex = pCont.NumParticles() pCont.particleAge = 0 pCont.particleTM = ChunksArray[tt].objecttransform pCont.particleShape = ChunksArray[tt].mesh a = ChunksArray[tt].objectOffsetRot as eulerangles aq = ChunksArray[tt].objectOffsetRot rq = (eulerangles 90 0 0) as quat nr = (inverse aq * rq) as eulerangles pCont.particleorientation = [ nr.x,nr.y,nr.z] ) ) )`````` My other thought is I need to normalise the quat values.... but then again, I dont actually understand what normalising a quat value does! Can anyone care to explain what it does, and in what situations you would want to normalise quat values? __________________ Patrick Macdonald Lighting TD : http://reformstudios.com Developer of Mission Control , the spreadsheet editor for 3ds Max share quote
 05 May 2008 davestewart Repeat-customer   Dave Stewart Animator / scripter United Kingdom Hey Patrick, Can you post a scene? __________________ Portfolio | Keyframes and Code share quote
 05 May 2008 reForm Expert portfolio Patrick Macdonald CG Artist reForm Studios London, United Kingdom http://www.reformstudios.com/03-res...low_problem.max When you run the anim you can see that the corner columns rotate as expected, at 45 degrees, as defined by the pivot I rotated on the source mesh objects. The 2nd and 3rd particles that appear are 180 degrees from where they should end up. If you select all the Box* objects and do a local rotate 90 on the x axis, you should be able to see the orientations that the particles should take when rotated 90 degrees. Thanks for taking a look. p. __________________ Patrick Macdonald Lighting TD : http://reformstudios.com Developer of Mission Control , the spreadsheet editor for 3ds Max share quote
 05 May 2008 davestewart Repeat-customer   Dave Stewart Animator / scripter United Kingdom Hmm... you may need to explain again what you are trying to achieve. I looked at the mesh pivots, and they are all aligned to the world XYZ, so I'm not sure what you're asking? Where do these mysterious 45 degree rotations come from - are they intentional? What's their purpose? If you can describe what you want to be seeing, I might be able to help. (I presume that you don't just want to align the particles with the original mesh, or you would have done that by now, yeah?) Cheers, Dave __________________ Portfolio | Keyframes and Code share quote
 05 May 2008 reForm Expert portfolio Patrick Macdonald CG Artist reForm Studios London, United Kingdom Argh , sorry about that. I must have reset the pivots before saving the maxfile. I've replaced the original file on the server with one that should have the pivots rotated. So you should be able to reload it using the link above. The look I want in this example is for the outer columns to fold out like petals. If you select the boxes and use rotate on the local x axis, the outer columns should all rotate away from the building core. This is because I have rotated the pivot on each side so that the y-axis is always pointing in to the centre of the collection. As you can see, the corner columns seem to match the behaviour you get when you manually rotate the mesh objects, but the inner columns rotate in the opposite direction. Sorry for not explaining this very clearly, its difficult to put into words! __________________ Patrick Macdonald Lighting TD : http://reformstudios.com Developer of Mission Control , the spreadsheet editor for 3ds Max share quote
 05 May 2008 davestewart Repeat-customer   Dave Stewart Animator / scripter United Kingdom Hey Patrick, I had a quick look but I probably don't have time to tinker properly (shame). One thing I definately would do would be to create a new scene with maybe 6 particles oriented in the unique source directions, definately have them all birth at the same time, then add the next event to make them rotate in sync. At the moment it's just too confusing with 184 particles being born one by one, then when I put in the rotate event, all rotating over each other! Good luck, sorry I can't be any help right now __________________ Portfolio | Keyframes and Code share quote
 05 May 2008 reForm Expert portfolio Patrick Macdonald CG Artist reForm Studios London, United Kingdom The red verticals are the source meshes. The green objects are the particles spawned with a [90, 0, 0] rotation applied using the birth script above. As you can see, the particle, when rotated through 90 degrees in the x direction, should point away from the y-pivot axis (green). The rotations are arbitary; I just want to see how to make a particle rotate by x-degrees match the source mesh thats rotated x-degrees. The problem is that by default the particle orientation is 0,0,0, even when an source objects pivot has been rotated. __________________ Patrick Macdonald Lighting TD : http://reformstudios.com Developer of Mission Control , the spreadsheet editor for 3ds Max Last edited by reForm : 05 May 2008 at 02:04 PM. share quote
 05 May 2008 CGTalk Moderation Expert Thread automatically closed 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. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote
 Thread Closed share thread

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Latest Entries     Featured 2D     Featured 3D     CG Awards     Community Awards Main     News     General Discussion     Off Topic     Recruitment         Temp Job Board Challenges     Rival Crimson X Chaos     Education     Demo Reel     Portfolio Review GROUPS WIP ADVICE     Pro Select     Art Direction and Interviews     New 2D/3D Sketchbooks 2018     WIP 2D/3D & Animation         WIP/Critique: 3D         WIP/Critique: 2D             Speedpaints & Sketchbooks         WIP/Critique: Animation     Partners and Groups         Kitbash 3D Thunderdome         Collaborative Projects Autodesk     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax Tutorials & Tips         3dsMax Resources         3dsMax SDK and MaxScript         Plugins & Add-ons         Particle Flow     Mudbox Featured Gallery ZBrush     Featured Zbrush Gallery     Pixologic ZBrush     Keyshot     Marvelous Designer Texturing     Allegorithmic Substance         Substance Designer         Substance Painter         Substance Featured Gallery     Texturing XYZ     Mari     Marmoset Toolbag Software     Maxon Cinema 4D         Cinema 4D Resources     Side Effects Houdini     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion     Additional Software         Lightwave 3D             LW Resources             LW Tutorials         The Foundry Modo             The Foundry Time Travel Challenge         E-on Software Vue         Photoshop / Painter         Blender         3DCoat Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling         Modeling Challenge             Member Model Collection     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders         Lighting Challenges     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     VR/AR     Master Virtual Reality with BrioVR     Workstation Builds     Game Engine     Graphics Programming     Technical and Hardware
Miscellaneous

All times are GMT. The time now is 11:51 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.