Light Manager & Scatter

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Light Manager & Scatter // The Garage

1  2  3  |  

Post by remnar // Sep 14, 2006, 4:14am

remnar
Total Posts: 105
This image was done using test code on a new feature that distributes a set number of copies onto edges. I have my own alignment code that seems to work ok on most instances, but I need someone who's good at math to make it work perfectly. There's a difference in using a actual point in space, and using a vector for alignment.


This is a delphi function that works similar to the truespace look at function. The difference here is that I am using a vector for the target. Yea, i'm still using delphi so bite me. :p I need to fix this so the Y axis is parallel to the Y axis in world space like it is with the look at tool. I was able to come up with this function using the information from Foley's computer graphics book.


procedure tsGNodeLookAt(pGNode: tsxGNODE; vTarget: CtsxVector3f);

var

axes, raxes: CtsxAxes3f;

mx: CtsxTxmx3f;

loc, rot: CtsxVector3f;

q: CtsxQuaternion;

begin

tsxGNodeGetAxesOrientation(pGNode, axes);

tsxGNodeGetLocation(pGNode, loc);

raxes.zaxis:= vTarget; // direction of flight

//raxes.zaxis:= v_sub(raxes.zaxis, loc); // calculate position difference

raxes.xaxis:= v_cross(axes.yaxis, raxes.zaxis);

raxes.yaxis:= v_cross(raxes.zaxis, v_cross(axes.yaxis, raxes.zaxis));

v_norm(raxes.xaxis);

v_norm(raxes.yaxis);

v_norm(raxes.zaxis);

mx:= mx_id;

mx_setx(mx, raxes.xaxis, True);

mx_sety(mx, raxes.yaxis, True);

mx_setz(mx, raxes.zaxis, True);

mx2quat(mx, q);

tsxQuaternionToEuler(q, rot);

tsxGnodeSetRotation(pGNode, rot);

tsxSceneRefresh();

end;

Post by Alien // Sep 14, 2006, 9:32pm

Alien
Total Posts: 1231
pic
Yea, i'm still using delphi so bite me. :p

Why would anyone criticise your use of Delphi? I was always led to believe it produced smaller, faster progs than VB. Then again, Object Pascal isn't the easiest language to learn, which may be why some might criticise it - I never got the hang of it. A quote I recently found may explain why. :)

It is practically impossible to teach good programming style to students that have had prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

-- Edsger Dijkstra


BTW - no, it wasn't VB that I used to dabble with - I couldn't get the hang of that either, the version of BASIC I used to use is somewhat older [Acorn BBC BASIC].

Post by Steinie // Sep 15, 2006, 1:11am

Steinie
Total Posts: 3667
pic
If you make a Scatter Object composed of a 100 smaller objects you can select them all and move as one by Ctrl and then selecting all of them. How would you make all 100 into one object in one click?
Is it possible to boolean with one click or glue, etc ? In other words
I want to turn all 100 into one object as quickly as possible. All further use would be to the one large object.

Post by GraySho // Sep 15, 2006, 2:00am

GraySho
Total Posts: 695
pic
If you make a Scatter Object composed of a 100 smaller objects you can select them all and move as one by Ctrl and then selecting all of them. How would you make all 100 into one object in one click?

Is it possible to boolean with one click or glue, etc ? In other words

I want to turn all 100 into one object as quickly as possible. All further use would be to the one large object.


Just select all 100 with CTRL+drag to draw a border around the objects to select, and pick the glue tool.


After that you might use the polycombine (http://home.mindspring.com/~clintonr/MyTruespace/PolyCombiner.html) plugin (by Clinton Reese) to convert them to a single mesh. Handles much, much faster than glued meshes, especially when you have 50+ subobjects.

Post by remnar // Sep 15, 2006, 2:34am

remnar
Total Posts: 105
Yahoo! I did it! I figured it out! How to rotate objects so they align on the edge whoohoo! But there are some kinks to work out. Such as it doesnt work well on a torus as you can see. I hope if I add this feature it will be useful. If not at least I'll use the alignment code.

Post by remnar // Sep 15, 2006, 2:54am

remnar
Total Posts: 105
Well crapola cola, I celebrated too soon. It looks like it works with a cube. However when I used a cone, it showed it's true nature. But I think i'm on the right track. What I want to do is create a axes where the Z axis is parallel to the edge normal. Y is parallel to the world Y axis. and X will of course be the cross product. I figured I could get the Y if I first get the X. Since the X axis is parallel to the edge.

edit: I found a way to fix some of the problems by getting the edge normal by averaging the normals of each face that share the edge. This works but there are still problems on a torus where it cannot seem to know if the edge is pointing on the other direction on the inner edges. And I kinda said it wrong from the beginning. I need X to be parallel to the edge before Y is aligned. The Y is calculated by the cross product of Z and X.

Post by Chester Desmond // Sep 15, 2006, 3:42am

Chester Desmond
Total Posts: 323
Can't help you with the math, but those last pics sure bring back memories of playing with PipeWorks!
Haven't played with scatter yet but Light Manager is totally awesome. Thanks!

Post by stan // Sep 15, 2006, 3:55am

stan
Total Posts: 1240
pic
Steinie ..you can also just select all 100 objects with the ctrl method and use "meshcollapse.tsx" that comes in ts7 tsx folder, it will create one object in one click :) ..also here is a link to Clinton's polycombine which works the same way..http://home.mindspring.com/~clintonr/MyTruespace/PolyCombiner.html

Post by Steinie // Sep 15, 2006, 4:22am

Steinie
Total Posts: 3667
pic
Just select all 100 with CTRL+drag to draw a border around the objects to select, and pick the glue tool.

Wouldn't I have to glue 100 times or does this work with one click of the glue tool?

Edit: Just saw your message Stan, will try this later. Thanks Graysho for your help, still would like to know what would happen using Glue. Is there a way to glue with one click?

Post by stan // Sep 15, 2006, 6:33am

stan
Total Posts: 1240
pic
Steinie, I do that method alot.. when selecting all but one object with the ctrl method and gluing to the remaining object..or select all with the ctrl method, click the glue icon and click on the selection..both ways work :D

you can also use the group tools in Scatter's "particle manager " "group particles by" section

Post by GraySho // Sep 15, 2006, 10:20am

GraySho
Total Posts: 695
pic
Wouldn't I have to glue 100 times or does this work with one click of the glue tool?


Edit: Just saw your message Stan, will try this later. Thanks Graysho for your help, still would like to know what would happen using Glue. Is there a way to glue with one click?


I wouldn't mention it if it wouldn't work the way I described it, would I? :D


Just try it yourself. Select a bunch of objects and click on the glue as sibling tool, that's it. They are all glued together.

Post by Eagle // Sep 20, 2006, 7:15pm

Eagle
Total Posts: 221
pic
will these plug-ins work with GameSpace?

Post by Steinie // Sep 21, 2006, 2:18am

Steinie
Total Posts: 3667
pic
Eagle I don't have it but I would just try it. If not someone else with that program will help you I'm sure.
Scan, Graysho and Remnar
Here is more of my work using Scatter Plugin: Now you know why I asked the glueing question!!!
http://forums1.caligari.com/truespace/showthread.php?p=15706#post15706

Post by stan // Sep 21, 2006, 3:59am

stan
Total Posts: 1240
pic
Steinie..don't forget you can group when doing a scatter use "grouping & rotation" or after in the particle manager "group particles by" :D

Eagle..it might work..try each version..there are some things in ts66 that are not in gamespace so the one for ts4.3 might get you scattering if you get errors loading the one for ts66..:)

Post by TomG // Sep 21, 2006, 6:33am

TomG
Total Posts: 3397
Most things compatible with tS6.6 will work with gS - the exceptions are things like NURBS and metaballs which are not included in gS, but then I am not aware of any pluigins built on NURBS or metaballs geometry.



The other major difference is rendering, in that gS wont do long sequences of large images, so you may want to be wary of plugins based around rendering.



Anything to do with copying objects, or editing regular poly geometry - which frankly most of the plugins are - should all work fine :)


HTH!

Tom

Post by stan // Sep 21, 2006, 6:42am

stan
Total Posts: 1240
pic
there are a few metaball and nurbs checkboxes in the ts66 version of Scatter that may give the api error..

Post by Eagle // Sep 21, 2006, 10:12am

Eagle
Total Posts: 221
pic
Paul told me he got it to work so I'm going to try it also. That for the Tip Tom I didn't know TS6.6 and GS1.6 were so close! ;)


always~

Vickie :p

Post by Eagle // Sep 21, 2006, 12:25pm

Eagle
Total Posts: 221
pic
These plugs work great in GS! I posted the link on the GS board for the people that don't come here and hang with you High-poly guys..hehehe~

here is what it looks like in GS,


the Before:

http://www.eaglesoftworxstudio.com/WORK/scatter1.jpg


and After:

http://www.eaglesoftworxstudio.com/WORK/scatter2.jpg

I can think of a lot of things this tool could be used for!


thanks again!


always~

Vickie ;)

Post by Chester Desmond // Sep 22, 2006, 3:24am

Chester Desmond
Total Posts: 323
I've heard of people getting shafted but that's ridiculous....

Post by Eagle // Sep 22, 2006, 6:14am

Eagle
Total Posts: 221
pic
HAhaha! never looked at it that way Chester, :D


This really is a cool tool~

Post by remnar // Sep 23, 2006, 9:44pm

remnar
Total Posts: 105
Looks like this plugin was useful. I was thinking I would need to write different code to make it work in game space, but maybe I dont. Which also brings me to the point, what is game space really? I have looked at it and read the info. It looks just like a stripped down version of truespace. I dont see any difference between the 2. They coulda just called it truespace light lol.

Post by remnar // Sep 26, 2006, 12:41am

remnar
Total Posts: 105
Just FYI, I am working on the new version of Scatter. The new version will have an additional roll up group for randomization. I also finished installing that edge scatter feature "fill area". It was difficult to stick tested code into the made scatter code as this particular feature worked a bit differently. I will try to apply the "fill area" feature to faces, which will use something similar to the existing RndFaceVerts option. Another feature i'd like to add is bounding collision. However the problem is not finding a collision but rather what to do if i find it. it'd be simple if objects were placed along the world plane but that is not always the case. The scatter max tool uses passes and checks if a collision occurs and if so, skip the current process and go to the next one. Thus it also depends on the randomization of placed objects. My code however does not do this. I will be adding randomization, but i am not sure how to do deal if a collision occurs. it's hard to explain: "how do i tell an object to move out of the way if a collision occurs but still stay on the surface". Using fill area, i may be able to do this using the passing routing. I also need to figure out how to scatter objects onto the surface of nurbs. If any one is good at understand how nurbs works, please email me. Only thing I can do with nurb curves is add objects at the control points and this isnt what I want to do. I like to also add volume scattering but then I'd have to get into theoretical science :p

Post by Steinie // Sep 26, 2006, 1:14am

Steinie
Total Posts: 3667
pic
Since this is a new version can you make the UI use less room? Maybe tighten up the interface...

Also after a Scatter it seems to return to default values or after a canceled Scatter I find I have to check all the settings again.


Since this is a popular plugin how about "Scatter" T-shirts......"I'm a Scatter Brain" .........



The last line was a joke.....


I'm glad your still working on these plugins for us!

Post by remnar // Sep 26, 2006, 1:38am

remnar
Total Posts: 105
This image was made from my idea of using the rndfaceverts option. What I will do is remove that old feature and replace it with this one. I hope you like the results.

Post by Steinie // Sep 26, 2006, 1:49am

Steinie
Total Posts: 3667
pic
Remnar,

Cool results! Was this done in one pass or a pass for each color/shape?

Post by remnar // Sep 26, 2006, 2:40am

remnar
Total Posts: 105
That was done in one pass. Then moved to particle manager so i could apply the gradient color. There is no uniformity because that's the way the order of objects is.

As for the UI. I have been fixing some things and making objects scale uniformally. This will be in the next version. However I cannot make it tighter than it is. It needs flexibility for the font size.

Post by remnar // Sep 26, 2006, 3:32am

remnar
Total Posts: 105
This was done a sphere. The sphere was then copied and size reduced to very small and plugged into the Gradient Fx Utility. Then i applied the size parameter into it. I deleted the originals and then painted with a soft glow basic shader then applied the gradient with particle manager. Thus you have the soft fuzzy look of the surface. The uniformity of the gradient color on the distributed objects was done merely by applying a spherical UV mapping on the group object.

Post by frank // Sep 26, 2006, 3:35am

frank
Total Posts: 709
pic
Really cool, Remnar!

Post by remnar // Oct 2, 2006, 11:23pm

remnar
Total Posts: 105
This is what i've been working on this face function for days. It's been bugging me why my brain can't figure out a algorithm for a simple concept, but I have come up with something close to what I wanted to do. I'd like your opinion on this based on the test image I made.

I also wanted to state a discovery in the 4.3 SDK. In the current Scatter 4.3 version, there is no fast grouping except advanced. However I discovered something that worked just like the tsxAddSubObj function in the 6.6 SDK: tsxSobjAddChild. This works just as fast and the same way. Why thy made that addsubobj function I dont know, but this function is just as fast. That 500 objects was created and grouped in a 2 seconds. My computer is just a Del Dimension 2400.

What I wanted to do for faces is the same as I did for edges: allow the user to set a number of objects and have them distributed evenly across the surface. Well this works but what do you think? I also should test with sizes so they all fit neetly, but i am not sure if it'd work with this algorithm.

Post by Plasma // Apr 2, 2007, 12:52am

Plasma
Total Posts: 13
pic
remnar, do you still provide the two plug-ins Light Manager and Scatter? Your website is unfortunately down and I don't find any mirrors where I can download these plug-ins.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn