Notifications
Clear all

[Closed] How to Wrapped move the bamboo books?

As you see,I have some boxs(120s or more) to simulation this bamboo books (the name is right?),I want move(curl? wrapped? sorry for my poor english) them from left to right,or move from bothsides to center in 60 sec(or more times)

How can I do this with the MaxScript like a magic?

Thank you very much!

7 Replies

Why not simply skin the book (one bone per wood piece) without maxscript?

1 Reply
(@dottob)
Joined: 10 months ago

Posts: 0

Thank you for your replay

I need the algorithm,I ‘ll not only use it with maxscript in 3dsmax,like away3d,papervison3d,etc.

There’s not really an “algorithm” for rigging things like that in maxscript, using only code. For an experienced rigger, they probably wouldn’t only use maxscript for the whole rig. You would instead probably have multiple things driving the transforms of the planks. Maybe by using cloth or skrinwrap, you could even use splineIK. Really, in this type of rig, I don’t think you would need maxscript much, if at all. You might be able to use maxscript for a UI with the rig, controlling, already existing parameters.

What are you trying to achieve outside of max? Making this rig creatable with one click in Maya or maybe have it simulated in a game? Maxscript just extends the application using things that already exist within it.

You might be able to make the rig using only code by using C++ and the SDK, and make a plugin for max. Using C++, you can probably use a lot of the same code for other application plugins.

1 Reply
(@dottob)
Joined: 10 months ago

Posts: 0

Indeed,in max there are multiple ways to achieve this. I thought maybe this could be achieve by pure code with maxscript. I still believe it would be :).

Let’s wait and see?Shake hands!

here is a basic setup… you can play with some parameters… everyone is free to make nice user interface for that:


  delete objects
  fn addLink parent gap:0 maxcount:1 &count: &nodes: = 
  (
  	if count < maxcount do
  	(
  		next = instance parent name:(uniquename parent.name) pos:(parent.pos + [(1 + gap)*parent.width,0,0]) wirecolor:(parent.wirecolor*0.95)
  		next.parent = parent
  		count = count + 1
  		insertitem next nodes 1
  		addLink next gap:gap maxcount:maxcount count:&count nodes:&nodes
  	)
  )
  fn makeChain maxcount = 
  (
  	gap = 0.05 
  	count = 0
  	nodes = #()
  	root = chamferbox name:"sleeper" width:2 length:20 height:0.5 fillet:0.1 fillet_segments:3
  	root.pivot = point3 (root.min.x + 0) root.center.y root.max.z
  	addLink root gap:gap maxcount:maxcount count:&count nodes:&nodes
  	t = 0
  	s = 5
  	d = 3
  	a = 90
  	k = 2
  	i = 0.4
  	with animate on for node in nodes do
  	(
  		at time (t+0) rotate node (eulerangles 0 0 0) 
  		at time (t+s) rotate node (eulerangles 0 -a 0) 
  		t += d 
  		a -= (k + i)
  	)
  )
  makeChain 20
  

if you want true math formula google for Spiral of Theodorus

1 Reply
(@denist)
Joined: 10 months ago

Posts: 0

i’m very kind today … so


delete objects
fn makeChain count = 
(
	gap = 0.05 
	parent = chamferbox name:"sleeper" width:2 length:20 height:0.5 fillet:0.1 fillet_segments:3
	parent.pivot = point3 (parent.min.x + 0.01) parent.center.y parent.max.z
	
	nodes = #()
	while count-1 > 0 do
	(
		node = instance parent name:(uniquename parent.name) pos:(parent.pos + [(1 + gap)*parent.width,0,0]) wirecolor:(parent.wirecolor*0.95)
		node.parent = parent
		count -= 1
		insertitem node nodes 1
		parent = node
	)

	start = 0
	step = 5
	delay = 3
	n = 0
	with animate on for node in nodes do
	(
		n += 1
		at time start rotate node (eulerangles 0 0 0) 
		at time (start + step) rotate node (eulerangles 0 (-pi*(atan (1./sqrt(n)))) 0)
		start += delay 
	)
)
makeChain 24

You just like the God Of The Maxscript!
I’ll try my best to digestion your Great Work!
And THANK YOU Specially for you GIVE ME A RIGHT WAY!