Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

How to display vector field after vertices' displacement?

Anonymous

How to display vector field after vertices' displacement?

Anonymous
Not applicable

Hi all,

 

I am wondering if this thing is actually possible in 3ds max. Basically, I have two editable meshes representing the same object at two different times. They are exactly the same (same number of points etc.), just in different configurations. I am studying the transition from time 1 to time 2. I applied the Morpher modifier to represent the motion between the two states. What I am interested in is to display the vectors that represent the displacement of each single vertex of the mesh between the initial and the final state. Basically I am looking for a way to connect corresponding vertices with a segment. I know this concept as 'vector field', representing the motion of a set of points in time. I know that 3ds max features a 'vector field space warp' object but that is NOT what I am looking for. Do you know if it's doable/any possible solutions to this problem? Thanks a lot!!

0 Likes
Reply
Accepted solutions (1)
684 Views
3 Replies
Replies (3)

leeminardi
Mentor
Mentor
Accepted solution

Here's a Maxscript that will draw lines between corresponding vertices of two selected objects.  Is this something like what you want?

image.png

image.png

-- Creates lines between corresponding vertices of two selected editable meshes.
-- No error checking is done.
-- v1  12/30/2020  LRM
--
objA = selection[1]
objB = selection[2]
nV = meshop.getNumVerts objA
nvt = nv as string
rollout vectorRollout3 "Morph Vectors" width:200 height:160
(
	button 'btnGo' "Go" pos:[32,104] width:96 height:36 align:#left
	edittext 'edt1' "" pos:[64,32] width:78 height:24 align:#left
	label 'lbl1' "Start vertex" pos:[0,32] width:65 height:15 align:#left
	edittext 'edt2' "" pos:[64,64] width:78 height:24 align:#left
	label 'lbl2' "End Vertex" pos:[0,64] width:56 height:16 align:#left
	label 'lbl3' "Total number of vertices:" pos:[0,8] width:120 height:17 align:#left
	label 'labelnverts' nvt pos:[128,8] width:48 height:19 align:#left
	on btnGo pressed do
	(
		vstart = edt1.text as integer
		vend = edt2.text as integer
	   morph_vectors vstart vend
		messagebox "Done"
	)
)
createdialog vectorRollout3 

fn morph_vectors vstart vend =
(	
-- Creates a line between corresponding vertices of two selected objects 
-- that have the same number of vertices.
--
for i = vstart to vend do
(	
pA = meshop.getVert objA i
pB = meshop.getVert objB i 
newLine = Line2Points pA pB
)

fn Line2Points pointA pointB =
(
  ss = SplineShape pos:pointA
  addNewSpline ss
  addKnot ss 1 #corner #line PointA
  addKnot ss 1 #corner #line PointB
  updateShape ss
  ss
)
)

 

 

lee.minardi
0 Likes

Anonymous
Not applicable

@leeminardi  Thank you very much!! This is surely a very helpful starting point! Do you have any ideas about how to make it more dynamic? I mean like automatically adapting the lines when I move one of the two meshes to always keep them connected? I am thinking about displaying somehow the changes in the lines' lengths during an animation (while using the morpher modifier would be perfect, but probably not doable?). Thank you again!

0 Likes

leeminardi
Mentor
Mentor

I am not skilled enough with Maxscripts to make the vectors dynamic.  I suggest you post the question on the 3ds Max Programming forum. 

lee.minardi