CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 05-11-2012, 01:31 PM   #46
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
I like the direction this is going a lot. I understand it doesn't look like the typical cobwebs....I've gear mine more towards the random look like this
ReferenceImage


Thanks gazybara for the code. I'm going to try it out now.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-11-2012, 01:36 PM   #47
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
Hey gazybara,
Do you have a gmail account or skype?
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-11-2012, 02:45 PM   #48
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
look in your hotmail inbox
__________________
Looking in the right side. [bgaTools]
 
Old 05-11-2012, 02:49 PM   #49
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
Subdivide spline

What is a good way of subdividing a spline X number of times with smooth knots?

Every time you add a knot it changes the spline segement index????

Code:
steps = 4 theShape = $ clearlistener() for idx = 1 to numSplines theShape do ( divideSeg = ceil (steps / numSegments theShape idx) as integer part = 1 for s = 1 to numSegments theShape idx do ( knot = subdivideSegment theShape idx (1*part) divideSeg part += (divideSeg*s) ) updateShape theShape )
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-11-2012, 02:56 PM   #50
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
When you use subdivide method then alwas use backward loop
ei
for idx in (numSplines theShape) to 1 by -1 do...
__________________
Looking in the right side. [bgaTools]
 
Old 05-11-2012, 03:21 PM   #51
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
Good exampele is this script by Garp
Resize Splines From First
__________________
Looking in the right side. [bgaTools]
 
Old 05-11-2012, 03:24 PM   #52
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
Alright sounds good.

I'll begin testing that and see what I get.
I've got some quite noticeable improvements which will be quite interesting once you get to mess with it.

If you feel up to it and want to further help out, I will eventually need to find a way to do this....

I have an array of 20 positions (point 3 values)
I need to collect only the ones whose positions fall within a given volume examples:a sphere.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-11-2012, 03:55 PM   #53
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
Try this
Code:
posArr = for p in 1 to 20 collect random (point3 0 0 0) (point3 1000 1000 1000) radius = 500 -- virtual sphere radius center = point3 0 0 0 -- virtual sphere center posInsideVirtualVolume = for p in posArr where distance p center < radius collect p
__________________
Looking in the right side. [bgaTools]
 
Old 05-11-2012, 04:48 PM   #54
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
nice clever way of doing that.
Good one.
I'm pretty excited about this next version.Will definitely be pretty versatile.
As far as those renders you mentioned lastnight, was one of those renders in the email you sent me?
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-11-2012, 04:57 PM   #55
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
I'm currently working on one big architectural project and i'm quite busy.
That render is a small test when I get a break from work.
I hope to have more free time to make some interesting render.
__________________
Looking in the right side. [bgaTools]
 
Old 05-12-2012, 12:05 AM   #56
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
break through

Some pretty big breakthroughs in the next build of cobwebs,
Thanks again for everyone's comments and help along the way.
Thanks Denis for making the remark that it does not appear to be radial like an actual web. In the next release it does just that. It needs a few performance tweaks but aside from that it is pretty close to being finished.

I'll have a post later tonight if anyone is around.
If anything be sure to check back tomorrow. For those who don't touch the pc over the weekends just check back at the beginning of the work week.

I look forward to hearing back from you guys.

john
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-12-2012, 04:36 PM   #57
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
I noticed with spline creation I have to do a complete redraw in order for the substrands to be created. Is there a way I can avoid doing that process as it slows down the script quite a bit?

I'll try to put together a basic sample script for quicker and easier testing. But if anyone happens to know the answer to this ahead of time id be glad to know.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 05-12-2012, 04:51 PM   #58
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
Another question

Alright so I've got an improvement suggestion from Branko and this is what he has suggested as a base.

It's definitely a quicker way of calculating random points on objects. I was wondering why this doesn't work on a cylinder or any shape other than a sphere very well?
When it boils down to it I'm trying to find ways to improve the processing of the script. One case is finding if there is a faster way of generating pos/point3 values on the surface of objects.

Code:
start = timeStamp() sph = geosphere radius:50 pos:[30,65,28] cyl = cylinder radius:50 height:50 pos:[100,50,28] objCol = #(sph,cyl) surfacePosArr = #() for obj in objCol do ( for i = 1 to 20 do ( seed (random 100000 999999) centRay = ray obj.center (random (point3 1 1 1) (point3 -1 -1 -1)) intRay = intersectRay obj centRay if intRay != undefined do ( append surfacePosArr intRay.pos -- create point helper to see intersection place (don't use in the script) point drawontop:on size:5 pos:intRay.pos wirecolor:(random (point3 0 0 0) (point3 255 255 255)) ) ) ) surfacePosArr -- intersection positions arr print surfacePosArr
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com

Last edited by JokerMartini : 05-12-2012 at 05:19 PM.
 
Old 05-12-2012, 05:39 PM   #59
gazybara
Architect
 
gazybara's Avatar
portfolio
Branko Živković
Freelancer
Niš, Serbia
 
Join Date: Apr 2011
Posts: 1,103
Quote:
Originally Posted by JokerMartini
I noticed with spline creation I have to do a complete redraw in order for the substrands to be created. Is there a way I can avoid doing that process as it slows down the script quite a bit?

I'll try to put together a basic sample script for quicker and easier testing. But if anyone happens to know the answer to this ahead of time id be glad to know.

I don't know about other way then *update shape fn*. It's good that you use it outside for-loop.
__________________
Looking in the right side. [bgaTools]
 
Old 05-12-2012, 05:50 PM   #60
JokerMartini
Expert
 
JokerMartini's Avatar
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles, USA
 
Join Date: Mar 2009
Posts: 1,307
Send a message via AIM to JokerMartini
does it work to do just an update shape and not have to do viewport redraw. i feel like the completeredraw shouldn't affect the spline creation no matter what.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:06 PM.


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