Jump to content

batteryoperatedlettuce

Members
  • Posts

    208
  • Joined

Personal Information

  • Country
    China

batteryoperatedlettuce's Achievements

Newbie

Newbie (1/14)

10

Reputation

  1. cool - knowing that now, I am surprised that I even managed to make a script that worked without using that method.
  2. I see what you mean. Thanks for your reply. The reason I took a round about way of creating my matrix to get the angle and then reseting the scale is because I want the objects to point outwards from the vertex. By outwards I mean the average angle of all the faces connected to that vertex. If therefore this script were applied to a ball, all the obects would be positioned at the verticies of the ball and face away from the center. For a more complex surface, the object faces "away" from all of the faces connected to the vertex. I haven't tried arbaxis and Z_axis. I usually only write a script when I have something I need to do fairly urgently, which is why it's written using only a few basic commands. I don't actually know how to code "properly". I'm reading into it now and I'm sure I'll be able to write this more efficiently based on the information you've given me.
  3. when you move a group in the UI in max it applies the transform to the dummy, but the information about the positions of stuff relative to each other inside the group is not an inherent part of the group - the group simply notes that it has nodes in it and that those nodes are instances of objects in your scene. You'll note that when you manually create an instance of a group in the UI, open it and move one of the objects, that the original group remains unaffected. Here, by writing "nnl.pos [1,2,1]", you are telling Max to apply a point3 value to the position transform of each of the objects inside your array "nnl" and it responds by aligning the pivot points of everything in your group including the dummy to that position. note that nnl contains the dummy as well as all of the objects; my group named "tigger", which contains 3 boxes returns an array "nnl" which looks like this #($Dummy:tigger001 @ [100.000000,100.000000,100.000000], $Box:christopher001 @ [110.000000,90.000000,100.000000], $Box:pinface001 @ [110.000000,110.000000,80.000000], $Box:piglet001 @ [90.000000,110.000000,100.000000]) you only need to do what max would do if you were moving a group around in the UI, which is move the dummy. piglet = mybox = box length:20 width:20 height:20 pos:[0,20,20] name:"piglet" christopher = box length:20 width:20 height:20 pos:[20,0,20] name:"christopher" pinface = box length:20 width:20 height:20 pos:[20,20,0] name:"pinface" select #($christopher, $pinface, $piglet) group selection name:"tigger" fn moveGroup newPos targetObj = ( select targetObj foo = maxOps.cloneNodes (selection as array) cloneType:#instance newNodes:&nnl #nodialog select nnl nnl[color="red"][1][/color].pos = newPos ) moveGroup [100,100,100] $tigger --nnl[2].pos = [200,200,200] /*remove the comment -- at the beginning of this line and one of the boxes in the group will be moved without affecting the original group instance*/
  4. This script aligns and orients objects to vertices By: 1)Taking a selection of vertexes and storing them as an array 2)asking the user to pick a piece of geometry 3)calculating the "orientation" of a vertex by --getting the faces which use that vertex --calculating and combining their local orientation 4)using that info to create a resultant matrix3 transform 5)copying the target object and applying the matrix3 transform to the object I made it to do things like add studs to fabric, or place oriented objects onto a mesh surface. It could easily be adapted to distribute randomly sized objects over a mesh There is a problem with it - the simple code I wrote, correctly solves the orientation, but it scales up the target object. I used a workaround to solve this by resetting the scale of the object to -1 -1 -1 for x,y,z respectively, on line 27: targetMesh.scale = point3 -1 -1 -1 I'm not an expert coder and would like some help making this more elegant. I think I understand the arithmetic I need to do to adjust the matrix at lines 19-21, but I don't know what the relationship is between the original scale of the object and the scale of the transform matrix I'm creating. If I could get some help with this, I'd really appreciate it. --- fn orientObjectToVertex targetVertVal targetMesh= ( --work out what bits of the target object have the info we need targetVert = targetVertVal --getVertSelection $ as array targetFaces = meshop.getFacesUsingVert $ targetVert as array --variable points faceNormal = point3 0 0 0 rightVector = point3 0 0 0 upVector = point3 0 0 0 --constants faceNum = targetFaces.count worldUpVector = [0,0,1] centerPos = getVert $ targetVertVal for i = 1 to faceNum do ( faceNormal += in coordsys $ (getFaceNormal $ targetFaces[i]) rightVector += normalize (cross worldUpVector faceNormal) upVector += normalize ( cross rightVector faceNormal) ) theMatrix = matrix3 rightVector upVector faceNormal centerpos targetMesh.transform = theMatrix targetMesh.scale = point3 -1 -1 -1 ) fn g_filter o = superclassof o == Geometryclass targetMesh = pickObject message:"Pick Target Surface:" filter:g_filter targetVertArray = getVertSelection $ as array targetObjectArray = #() for q = 1 to targetVertArray.count do ( targetObjectArray[q] = instance targetMesh orientObjectToVertex targetVertArray[q] targetObjectArray[q] )
  5. I should clarify - I am basically trying to set up a solid material affect which I can apply to objects in my scene which makes them behave as if they were "solid" and made of this material. I have already written a script which will auto-assign IDs [1,2,3] based on local face orientation, but this workflow is too clumsy and besides, does not "gradient" or "cross fade" the materials based on their orientation toward one of the three axial planes. This will require a much more horrible max script, so I want to make sure that there is no way of doing this with a material. If there really isn't then... come on guys!
  6. I am trying to make a material which will aproximately simulate a solid piece of wood. A typical piece of plywood has a "flat grain" an "edge grain" and a "head grain" I would like to be able to apply this to an object and have the material apply one of three different bitmap textures, depending on the orientation (local to the object) of the face (with gradients between the three maps in cases where faces are not completely aligned). Is this possible with vray 2 or with existing composite materials, or do I need to make a script? Many thanks as always in advance - And happy Chinese new year to everyone!
  7. very nice - your light settings match the chosen backdrop very well.
  8. Lots of people are about to tell you that there are no exact settings and that you need to work through some tutorials (of which there are plenty), search the site to find what you're looking for and join the chaosgroup forums and start asking more specific questions, perhaps provide some examples of your work and current settings to work from.... and so on. And they're right
  9. If we all pick on him and bully him enough we might actually get some blue skys and sunny days out of him
  10. I like the quality - the photoshoped elements are fairly consistent with the quality of the rendering, which is good. I agree with the coment about the angle. something which shows more of the building would be nicer.
  11. Shouldn't imagine so. They probably have great insulation... But I wouldn't like to live a short distance to either side of them.... ....how far is this going to go before the thread gets deleted
  12. Don't worry about the lack of comments - keep going and keep updating. The model is looking great. I'm really looking forward to seeing where this goes. In the image you linked to up there, I'd say that palm tree is looking a bit low poly. A very angular appearance, I'd change it, or mesh smooth some of the nearer leaves. Also the green looks a bit light for palm leaves. Can it go a bit darker? They could do with having some more highlights too.
  13. feels like you've got the sun lighting scheme sorted out - what settings are you using? Now you're comfortable with the lighting, it's time to move on to details, modeling and texturing. looking good.
×
×
  • Create New...