George,

I got the email, thanks. The problem was that when I copied and pasted the script into the andquot;create scriptandquot; window in 3DC, then tried to save it is when I got the error message. I’ll try copying from the email and see if it makes any difference.

Thanks again,

Les

Using scripting, would it be possible to;

1) create a sphere(and make it invisible)

2)fill the sphere with fog, or particles that would be visible and restrict it to just the area inside the sphere

3)control density, color, etc of the fog/particles

Would it be possible to do this without having to have a camera inside the sphere?

Les

George,

Well it certainly would be a first for me, as I am a complete virgin to scripting…ha ha.

What I’m thinking of is using this type of object to simulate a andquot;visible lightandquot; object. I was thinking that if it were possible to fill an invisible sphere with particles where the color, brightness, density, etc, could be controlled, then we could get a visible light source right in 3DC.

The color and brightness reasons are obvious, but the density control would be just as important for creating a andquot;glowingandquot; effect. I think the glowing might be achieved by making the particles near the center of the sphere have the highest density value, and reducing that value towards the outer area of the sphere, probably in increments.

Your idea of a spherical astroid field is worth looking into also. That would be cool in a game.

I may be barking up the wrong tree completely here, but I believe there must be a way to do this in 3DC, whether it’s with scripting, or some other method.

Thanks for your reply, and yes I would appreciate any help you could offer.

Les

P.S.

I can somewhat simulate this by creating an invisible sphere in 3DC and filling it with particles using the particle operation. The problem I’m having with my video card is causing me not to be able to see everything that I’m working on. I hope to cure this problem very shortly.

Hi Les

it is certainly possible (and fairly easy) to create a spherical space filled with a distribution of particles, but I don’t know if it would do what you want.

If you’re trying to simulate scattering – and I have no idea how this is done in raytracing places – then you have to create particles with size similar to the wavelength of light. andnbsp;I assume the wavelength of light in raytracing is 0…

If you used small, randomly oriented planes, it might work, but you would need a hell of a lot, wouldn’t you? andnbsp;I thought at first you would use tetrahedra, but don’t see now if that would be any better.

In any case, it should be fairly easy to try, and loads of fun andnbsp; <!– s:-) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="" title="Smile" /><!– s:-) –>. andnbsp;If nothing else you’ll end up with a spherical asteroid field to send your ships into. andnbsp;If you want to try, I don’t mind helping you with the code (if this is your first time)

George

Hi Les

I see what you want to do but is it computationally efficient? andnbsp;I thought you were writing games,

and to have 10000 particles for a glowing light seems ….excessive?

Could you do it with say a radial filter in front of the light? andnbsp;Or put the light in a bunch

spheres?

Dunno, in any case the other program sounds interesting. andnbsp;It would be useful in creating

swarms of objects like insects. andnbsp;A year ago there was an interesting article in Scientific

American (?I think) about artificial life, and I’ve thought about animating schools of fish.

I would start with a class declaration

Class Swarm

andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp;Public andnbsp; andnbsp;Radius

andnbsp; andnbsp;Public andnbsp; andnbsp;NumberOfParticles

andnbsp; andnbsp;Public andnbsp; andnbsp;SizeOfParticles

andnbsp; andnbsp;’and anything else that you need to know

End Class

Public S

Then you make a variable S of type Swarm

set S=new swarm

Then I would have a different subroutine for every type of object I wanted to make

When I want a particular objet swarm, I comment out the others so only one

is defined by the script

MakeGlaryLens

‘MakeFireFlies

sub MakeGlaryLens

andnbsp; andnbsp; andnbsp; with S

andnbsp; andnbsp; andnbsp; andnbsp;.Radius=1

andnbsp; andnbsp; andnbsp; andnbsp;.NumberOfParticles=10000

andnbsp; andnbsp; andnbsp; andnbsp;.SizeOfParticles=.001

andnbsp; andnbsp; andnbsp; end with

End sub

sub FireFlies

andnbsp; andnbsp; andnbsp; with S

andnbsp; andnbsp; andnbsp; andnbsp;.Radius=10

andnbsp; andnbsp; andnbsp; andnbsp;.NumberOfParticles=100

andnbsp; andnbsp; andnbsp; andnbsp;.SizeOfParticles=.1

andnbsp; andnbsp; andnbsp; end with

End sub

In the main sub you have

For Counter=1 to S.NumberOfParticles

andnbsp; andnbsp; andnbsp;MakeLocation andnbsp; ‘random location inside sphere of radius S.Radius

andnbsp; andnbsp; andnbsp;MakeFace andnbsp; andnbsp; andnbsp; ‘little particle of size S.SizeOfparticles – random orientation

andnbsp; andnbsp; andnbsp;AddMaterialToFace

andnbsp; andnbsp; andnbsp;AddFacetoSwarmObject

Next

AddSwarmObjectToModel

…..

To make fireflies, I would make just one, and use the script to copy it 100 times to

random locations…sound logical? andnbsp;

If the glary object works it would be interesting to play around with polarisation – you can

control the orientatin of the little objects….

You might like to know I’ve started writing a scripting tutorial.

I want Richard to check it for factual content before it’s published, but you

might like to check it out

[img:1p98e7p7]http://users.belgacom.net/fcp/3DC/index.html[/img:1p98e7p7]

<!– m –><a class="postlink" href="http://users.belgacom.net/fcp/3DC/index.html">http://users.belgacom.net/fcp/3DC/index.html</a><!– m –>

It describes how I make a pallette of materials to copy onto object made in a script, and I

would apply it in this case.

I’ve got a sick kid home from school today so won’t be working at the ‘puter. andnbsp;Have fun.

Geo

George,

I really appreciate you taking the time to help with this.

I’m going to work with this script and see how it operates, and what all I can do.

Thanks again, and I hope the kid gets better soon.

Les

George,

I can’t get 3DC to run this script at all. I keep getting an error that says it’s unable to detirmine script language, and that it has to be written in the first line of code. Problem is, it IS there. I can plainly see the first line of code reads andquot;Language = VBScriptandquot;, so I’m stumped…… <!– s:( –><img src="{SMILIES_PATH}/icon_e_sad.gif" alt="" title="Sad" /><!– s:( –>

Les

P.S.

Other than your tutorial(which is written superbly I might add, and easy to understand), are there any other andquot;easy to understandandquot; books/tutorials that I might get to help me, since I’m a total beginner? I don’t absolutely have to learn evry possible thing there is to know about scripting, but I am interested in a few different areas.

it’s not quick. maybe 30 secs? andnbsp;I’m only on a 600M celeron laptop, so not great for graphics.

you change density at these lines if you haven’t found it:

sub MakeLens

with S

andnbsp; andnbsp; .SwarmRadius=1

andnbsp; andnbsp; .NumParticles=3000

andnbsp; andnbsp; .SizeParticles=.01

end with

Hey there

I just altered my flower maker to do this andnbsp;- didn’t take very long and I can use it for other stuff: hope it’s not too long for the message. andnbsp;You need the PaintStrip from my tutorial, otherwise the planes come out purple – you then bucket fill the object with the material you want.

All objects are oriented only one way – you’re mission is to fix the geometry to randomise them – and check I’ve filled the sphere correctly. andnbsp;The picky attached shows 3000 planes around a point light.

Good luck. andnbsp;Code starts here.

Language = VBScript

Option Explicit andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’require variable declarations

Class SwarmClass

andnbsp; andnbsp; andnbsp; andnbsp;’this class describes the flower

andnbsp; andnbsp;Public andnbsp; andnbsp;SwarmRadius

andnbsp; andnbsp;Public andnbsp; andnbsp;NumParticles

andnbsp; andnbsp;Public andnbsp; andnbsp;SizeParticles

End Class

andnbsp; andnbsp;Public andnbsp; andnbsp;NumMaterials

andnbsp; andnbsp;Public andnbsp; andnbsp;Scene

andnbsp; andnbsp;Public andnbsp; andnbsp;Face andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; ‘The face we are creating at anytime in the proggy

andnbsp; andnbsp;Const andnbsp; andnbsp; Pi= 3.14159265358979

andnbsp; andnbsp;Public andnbsp; andnbsp;S andnbsp; ‘the swarm of objects

‘*********************************************************************************

‘ Purpose: Creates a Swarm of planes

‘*********************************************************************************

Sub Main (3DCApp)

‘ andnbsp; andnbsp;Dim Scene andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’The current active scene

andnbsp; andnbsp;Dim SceneRootFrame andnbsp; ‘The root frame of the scene

andnbsp; andnbsp;Dim SwarmFrame andnbsp; andnbsp; andnbsp; ‘a frame for our object andnbsp; andnbsp;

andnbsp; andnbsp;Dim Swarm andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’what we are making

andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp;Dim SwarmX andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp;Dim SwarmY

andnbsp; andnbsp;Dim SwarmZ andnbsp; andnbsp; andnbsp; andnbsp;’where to put the swarm

andnbsp; andnbsp;Dim Theta andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’angle for making circle stuff

andnbsp; andnbsp;Dim Phi

andnbsp; andnbsp;Dim Pi2 andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’2 * pi

andnbsp; andnbsp;Pi2=2*Pi

andnbsp; andnbsp;Dim i andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’just a little loopy

andnbsp; andnbsp;Dim Materials() andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp;Dim ThisX andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’for the current element made in the loop

andnbsp; andnbsp;Dim ThisY

andnbsp; andnbsp;Dim ThisZ

andnbsp; andnbsp;Dim ThisRadius

andnbsp; andnbsp;Dim SwarmPointCounter andnbsp; ‘for counting what has been made

andnbsp; andnbsp;Dim SwarmLoop andnbsp; andnbsp; andnbsp; andnbsp;’for looping

set S=New SwarmClass

MakeLens

‘MakeFirefly

andnbsp; ‘ get the scene

andnbsp; andnbsp;Set Scene = 3DCApp.GetActiveScene

andnbsp; andnbsp;’find the index of the objects

‘ andnbsp; andnbsp;MaterialsObjectIndex = inputbox(andquot;What object for materials?andquot;,,0)

andnbsp;’get the root frame

andnbsp; andnbsp; andnbsp; andnbsp;Set SceneRootFrame = Scene.GetRootFrame

andnbsp; andnbsp; andnbsp; andnbsp;Set SwarmFrame = Scene.CreateFrame

andnbsp; andnbsp; andnbsp; andnbsp;SceneRootFrame.AddChild SwarmFrame

andnbsp; andnbsp; andnbsp; andnbsp;SwarmFrame.SetName andquot;Swarm Frameandquot;

andnbsp; andnbsp; andnbsp; andnbsp;Set Swarm = Scene.CreateObject()

andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp;’add a dummy normal to the object (we need one to add the points)

andnbsp; andnbsp; andnbsp; andnbsp; Swarm.AddNormal 0,0,-1

andnbsp; andnbsp;NumMaterials=6

andnbsp; andnbsp;Redim Materials (NumMaterials-1)

andnbsp; andnbsp;SetUpMaterials Materials

andnbsp; andnbsp;SwarmX=10 andnbsp; andnbsp; ‘where the Swarm is put in the model

andnbsp; andnbsp;SwarmY=10

andnbsp; andnbsp;SwarmZ=10

andnbsp; andnbsp;’Main loop to create faces in Swarm Objec

andnbsp; andnbsp;For SwarmLoop = 1 to S.NumParticles

andnbsp; andnbsp; andnbsp; andnbsp;Randomize

andnbsp; andnbsp; andnbsp; andnbsp;’find radius of point andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp;ThisRadius=S.SwarmRadius*Rnd andnbsp; andnbsp; andnbsp;’random radius in the sphere

andnbsp; andnbsp; andnbsp; andnbsp;’where is it?

andnbsp; andnbsp; andnbsp; andnbsp;Theta=2*Pi*rnd

andnbsp; andnbsp; andnbsp; andnbsp;Phi=Pi*rnd

andnbsp; andnbsp; andnbsp; andnbsp;ThisX = SwarmX+ThisRadius*sin(Theta)*cos(Phi)

andnbsp; andnbsp; andnbsp; andnbsp;ThisY = SwarmY+ThisRadius * sin(Phi)

andnbsp; andnbsp; andnbsp; andnbsp;ThisZ = SwarmZ+ThisRadius * cos(Theta)*cos(Phi) andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; ‘Now we create the petals points for just this petal andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; ‘Lets make the faces in the petal before moving on

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Set Face = Swarm.CreateFace

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’we have to add 4 points per face as they will all have different UVs

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’add the quad points to the object andnbsp;

‘THIS IS JUST QUICK – HAVEN’T WORKED OUT REAL andnbsp;POINT COORDS

andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Swarm.AddPoint ThisX-S.SizeParticles,ThisY-S.SizeParticles,ThisZ-S.SizeParticles

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Swarm.AddPoint ThisX-S.SizeParticles,ThisY+S.SizeParticles,ThisZ-S.SizeParticles

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Swarm.AddPoint ThisX+S.SizeParticles,ThisY+S.SizeParticles,ThisZ+S.SizeParticles andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Swarm.AddPoint ThisX+S.SizeParticles,ThisY-S.SizeParticles,ThisZ+S.SizeParticles

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’add the points and the normal to the face

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Face.AddPointAndNormal 0+SwarmPointCounter,0

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Face.AddPointAndNormal 1+SwarmPointCounter,0

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Face.AddPointAndNormal 2+SwarmPointCounter,0

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Face.AddPointAndNormal 3+SwarmPointCounter,0

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Swarm.SetPointTextureCoordinate 0+SwarmPointCounter,-1,0

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Swarm.SetPointTextureCoordinate 1+SwarmPointCounter,-1,-1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Swarm.SetPointTextureCoordinate 2+SwarmPointCounter,0,-1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Swarm.SetPointTextureCoordinate 3+SwarmPointCounter,0,0

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;SwarmPointCounter=SwarmPointCounter+4

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; ‘apply the material to the face

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Face.SetMaterial Materials(0)

andnbsp; andnbsp;Next andnbsp; ‘SwarmLoop

andnbsp; andnbsp; andnbsp; andnbsp;

‘msgbox(andquot;finished all loopingandquot;)

‘add the object to the created frame

andnbsp; andnbsp; andnbsp; andnbsp;’this also triggers the update to the database

andnbsp; andnbsp; andnbsp; andnbsp;SwarmFrame.AddObject Swarm

andnbsp; andnbsp; andnbsp; andnbsp;’set the object name – note that we can’t do this until

andnbsp; andnbsp; andnbsp; andnbsp;’the object is added to a frame

andnbsp; andnbsp; andnbsp; andnbsp;Swarm.SetName andquot;Swarmandquot;

end sub

sub SetUpMaterials(M())

andnbsp; andnbsp; andnbsp;dim i

andnbsp; andnbsp; andnbsp; andnbsp;dim j

andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp;dim MaterialsObjectIndex

andnbsp; andnbsp; andnbsp;dim MaterialsObject

andnbsp; andnbsp; andnbsp;dim MatFace

andnbsp; andnbsp; andnbsp; andnbsp;dim FaceCount

andnbsp; andnbsp; andnbsp; andnbsp;dim MatCount

andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp;dim NumFacePoints

andnbsp; andnbsp; andnbsp; andnbsp;dim dummyNum

andnbsp; andnbsp; andnbsp; andnbsp;dim dummyX

andnbsp; andnbsp; andnbsp; andnbsp;dim dummyZ

andnbsp; andnbsp; andnbsp; andnbsp;dim ThisY

andnbsp; andnbsp; andnbsp; andnbsp;dim Altitude()

andnbsp; andnbsp; andnbsp; andnbsp;dim AltitudeOrder()

andnbsp; andnbsp; andnbsp; andnbsp;dim MinPlace

andnbsp; andnbsp; andnbsp; andnbsp;dim CurrentMin

andnbsp; andnbsp; andnbsp; andnbsp;dim ActiveObjectCount

‘get the active object count

andnbsp; andnbsp;ActiveObjectCount = Scene.GetActiveObjectCount

andnbsp; andnbsp;’only proceed if there is an active object

andnbsp; andnbsp;If ActiveObjectCount = 0 Then

andnbsp; andnbsp; andnbsp; andnbsp;MsgBox andquot;You didnt select an object so I’ll color me pinkerooandquot;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;for i= 0 to NumMaterials-1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Set M(i) = Scene.CreateMaterial

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; ‘make it a nice color

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;M(i).SetColor .894/(i+1),.773/(i+1),.788/(i+1)

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; ‘set the default diffuse value

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;M(i).SetDiffuse 60

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; ‘set the default ambient value

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;M(i).SetAmbient 20

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Next

andnbsp; andnbsp; andnbsp;else

andnbsp; andnbsp; andnbsp;set MaterialsObject=scene.GetActiveObject(0)

andnbsp; andnbsp; andnbsp; andnbsp;FaceCount=MaterialsObject.GetFaceCount

‘ andnbsp; andnbsp; andnbsp; andnbsp;msgbox(andquot;FaceCountandquot;andamp;FaceCount)

andnbsp; andnbsp; andnbsp; andnbsp;redim Altitude(FaceCount-1) andnbsp; ‘the averege y of the materials planes

andnbsp; andnbsp; andnbsp; andnbsp;redim AltitudeOrder(FaceCount-1) andnbsp;

andnbsp; andnbsp; andnbsp; ‘Create andnbsp;appropriate materials for the faces

andnbsp; andnbsp; andnbsp; andnbsp;For i=0 to NumMaterials-1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Set M(i) = Scene.CreateMaterial

andnbsp; andnbsp; andnbsp; andnbsp;Next

andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp;For i=0 to NumFacePoints-1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Altitude(i)=0

andnbsp; andnbsp; andnbsp; andnbsp;Next

andnbsp; andnbsp; andnbsp;For i=0 to FaceCount-1

andnbsp; andnbsp; andnbsp; andnbsp;set MatFace=MaterialsObject.GetFace(i)

andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp;NumFacePoints=MatFace.GetPointCount

andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp;For j=0 to NumFacePoints -1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; dummyNum=MatFace.GetPoint(j)

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; MaterialsObject.GetPoint dummyNum,dummyX,ThisY,dummyZ

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;’first add teh height to Altitude

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Altitude(i)=Altitude(i)+ThisY

andnbsp; andnbsp; andnbsp; andnbsp;Next

andnbsp; andnbsp; andnbsp; andnbsp;Altitude(i)=Altitude(i)/NumFacePoints andnbsp;

‘ andnbsp;msgbox(andquot;Alt andquot;andamp;Altitude(i)) andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp;Next andnbsp;

‘now we have to sort them into height to give the materials which 3dc seems to reorder andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; For i=0 to FaceCount-1

andnbsp; andnbsp; andnbsp; andnbsp; MinPlace=0

andnbsp; andnbsp; andnbsp; andnbsp; CurrentMin = Altitude(0)

‘ andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;….need to make an array with 214503 in it then bla

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; for j=0 to FaceCount-1 andnbsp;

‘msgbox(andquot;Alt jandquot;andamp;Altitude(j)andamp;andquot; CurrentMin andquot;andamp;CurrentMinandamp;andquot; MinPlace andquot;andamp;MinPlace) andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; if Altitude(j)[CurrentMin then

‘msgbox(andquot; after if Alt jandquot;andamp;Altitude(j)andamp;andquot; CurrentMin andquot;andamp;CurrentMinandamp;andquot; MinPlace andquot;andamp;MinPlace)

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;MinPlace=j

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;CurrentMin=Altitude(j) andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; end if

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Next

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; AltitudeOrder(i)=MinPlace

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; Altitude(MinPlace)=10000 andnbsp; ‘get it out of the way

andnbsp; andnbsp; andnbsp; ‘ andnbsp; andnbsp;msgbox(andquot;Alt orderandquot;andamp;AltitudeOrder(i))

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;Next

andnbsp; andnbsp; andnbsp; andnbsp; For i=0 to FaceCount-1

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; set MatFace=MaterialsObject.GetFace(AltitudeOrder(i))

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; set M(i)=MatFace.GetMaterial

andnbsp;’ andnbsp;’ andnbsp; msgBox(M(i).GetTextureFileName)

andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; MatCount=MatCount+1

andnbsp; andnbsp; andnbsp; andnbsp;Next ‘i

‘

‘we now have the six materials in Material() I hope

andnbsp; andnbsp; andnbsp; andnbsp;end if

end sub

sub MakeLens

with S

andnbsp; andnbsp; andnbsp;.SwarmRadius=1

andnbsp; andnbsp; andnbsp;.NumParticles=3000

andnbsp; andnbsp; andnbsp;.SizeParticles=.01

end with

End sub

George,

The pic is a little dark, but I can see the results of the script pretty well. This may be very close to what I’m looking for.

The density factor will probably turn out to be the most important, as I can easily set different colors to the object.

How long did it take 3DC to complete running the script and create the object on your machine. I’m assuming you are not having any problems like I am(vidcard).

I will work with the script and let you know what I come up with. Thanks again,

Les

bummer..I’ve send the script as an email attachment to the address in your profile. andnbsp;If it’s in the script directory when you start 3Dc it should work….

sending now no batteries. andnbsp;good luck. andnbsp;glad you like tute.

g

You must be logged in to reply in this thread.