Track Maker Script

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.

Track Maker Script // The Garage

1  |  

Post by ProfessorKhaos // Jul 28, 2007, 3:31pm

ProfessorKhaos
Total Posts: 622
pic
Thought I'd go ahead and start a new thread for this project. Plan to work it into the Rube Goldberg thread eventually, but there's much to do before that can happen and I didn't want to clutter the other thread.


=========================================


The goal:


1. Develop a tS7.5 based roller coaster track generating script that can take it's info from external text files. It should support mixing and matching different track paths with track cross sections.


2. Support ability to animate an object along the track


=========================================


Old Resources:


This project was done before in python and tS6.6. See link here:


http://forums.caligari.com/discus/messages/1585/10466.html?1062223989


=========================================


Design:


Wanted to take a modular approach to this project. Modules are as follows (so far):


----------------------------------------


-File Reader (2x)

--input:

---filename


--output:

---multiline text contained within file


--use:

---allows user to specify and read in cross section template file and track path file


----------------------------------------


-Comment Dropper (2x)

--input:

---string of multiline text

---several settings to remove blank lines, tokenize input, remove comments


--output:

--- input text filtered and formatted as specified


--use:

---removes comments, blank lines, and extra whitespace within lines read from cross section template file and track path file


----------------------------------------


-Template generator


--inputs:

---"comment dropped" multiline text data from the cross section template file

----field 1 = x coordinate of 2D template point

----field 2 = y coordinate of 2D template point

----field 3 = sharpness indicator for normals using this template point


--outputs:

--- multiline text data containing the following information

----field 1 = x coordinate of 2D template point

----field 2 = y coordinate of 2D template point

----field 3 = x axis of normal (for end of previous polygon edge)

----field 4 = y axis of normal (for end of previous polygon edge)

----field 5 = x axis of normal (for start of next polygon edge)

----field 6 = y axis of normal (for start of next polygon edge)


--use:

---Eliminates adjacent duplicate points which could cause problems calculating normals

---Creates normals for vertices based on which edge it's attached to and if sharpness has been turned on or not.


--notes:

---Values created by this routine is specific to the cross section template and I didn't want to always recalculate them inside the mesh generator if only the track plan was being updated


----------------------------------------


-Track Plan Generator


--inputs:

---"comment dropped" multiline text data from the track plan file

----format TBD (may be revised)


--outputs:

---multiline text data with the following fields

----field1 = track x coordinate

----field2 = track y coordinate

----field3 = track z coordinate

----field4 = track roll info

----field5 = track pitch info

----field6 = track yaw info


---other output to be fed to physics section TBD (may be revised)


--use:

---feeds track mesh generator info required to build the mesh

---feeds track physics sim info required to determine car behavior and location on the track.


--notes:

---Values created by this routine is specific to the track plan and I didn't want to always recalculate them inside the mesh generator if only the cross section template was being updated



----------------------------------------


-Track Mesh Generator


--input:

---data from Template Generator

---data from Track Plan Generator


--output:

---mesh data representing roller coaster track


--use:

---obvious (I hope)


----------------------------------------


-Track Physics Sim


--input:

--data from Track Plan Generator

--timing or frame number (TBD)


--output:

---matrix data for moving an object along track


--use:

---procedural simulation of a roller coaster car (use is optional)


--note:

---simulation mentioned above is not the built in physics engine within trueSpace. It is a custom sim designed to solve a very specific family of problems.


=========================================


Progress:


-File Readers - complete

-Comment Droppers - complete

-Template Generator -complete

-Track Plan Generator -

-Track Mesh Generator -

-Track Physics Sim -


Image below shows completed components. Track Mesh Generator will be hooked up to the Shape brick when complete and the Unit Cube Mesh Maker will be removed. Placeholder for Track Physics Sim has not been created at this time.

Post by 3dvisuals dude // Jul 29, 2007, 2:12am

3dvisuals dude
Total Posts: 1703
pic
Wow.

Thank you for doing all this for the Community ProfessorKhaos.

I think I can safely say that we're all already in awe of your work on this project so far, and we'll all be watching this thread from now on carefully, rest assured.

- 3dvisuals dude

Post by ProfessorKhaos // Jul 29, 2007, 3:35am

ProfessorKhaos
Total Posts: 622
pic
Thanks 3DVisuals Dude :)


The sick truth of it all is that I enjoy making all this stuff. Awe would be a matter of perspective though since I'm continuously impressed by the artistic talent around me here. For instance, I can write scripts well but I've not much clue on character design to avoid folding and warping of the mesh in the wrong spots. I have to follow tutorials for that and even then often don't know why something's done a particular way till I get much nearer the end.

Post by frootee // Jul 29, 2007, 11:43am

frootee
Total Posts: 2667
pic
Hey P.K.


Nice.


Thanks for giving us a status! Looking forward to working with it!


Froo

Post by 3dvisuals dude // Jul 29, 2007, 2:33pm

3dvisuals dude
Total Posts: 1703
pic
Thanks 3DVisuals Dude :)

The sick truth of it all is that I enjoy making all this stuff. Awe would be a matter of perspective though since I'm continuously impressed by the artistic talent around me here. For instance, I can write scripts well but I've not much clue on character design to avoid folding and warping of the mesh in the wrong spots. I have to follow tutorials for that and even then often don't know why something's done a particular way till I get much nearer the end.

Well I'm truly happy you enjoy making these things, they certainly look like a great deal of brain-wrenching work to me, but then that's a matter of my limited brainpower in that regard for sure! We're all great at something and lacking at something else, such is life! I used to go to high school with a close friend who had a 170+ I.Q., the poor guy was the most socially inept person you'd ever be likely to meet, but if you ever had a problem of any kind that needed really deep thought... he was definitely the man to seek out.

As for the "folding and warping of mesh in the wrong spots," I know exactly what you mean on that. I've found that the Spiraloid and Wings3D forums are superb sources of related solutions myself, creating fully articulable (is that a word?!?) meshes for animation is really largely a matter of sound edgeloop design principles, nevertheless I consider that a "high art" in my book too!

After seeing the highly detailed post and genuinely ambitious project you started with this thread I was thinking people might be hesitant to say anything at all in response to such an overwhelming effort in the way of support, perhaps feeling as inadequate as I do in regard to their abilities to offer assistance... nevertheless I did want to assure you of the sincere appreciation this project will be met with by many of us, since you will likely be going this alone!;)

You are blazing new trails for all of us you know, and I'm very happy you enjoy the work as much as we will all no doubt enjoy your success.

- 3dvisuals dude

Post by Délé // Aug 4, 2007, 2:51pm

Délé
Total Posts: 1374
pic
Very cool PK! You da man! :D


Just the file reader alone I'm sure will prove useful. I can't wait to try it out. :)

Post by 3dvisuals dude // Aug 16, 2007, 1:18am

3dvisuals dude
Total Posts: 1703
pic
Hi ProfessorKhaos,

I just wanted you to know, in case you may not already know, that we are currently working on a method to guarantee that Avatars within truePlay scenes will actually be able to ride rollercoasters without the danger of being ejected, even when upside down. I believe we are extremely close to that specific solution right now in fact. If we succeed in this as I expect very soon, your efforts here could well be met with the actual potential of using them live in multi-user shared space, which would clearly be the most momentous thing to ever happen there.

I'm never giving up on that objective, WE WILL make it happen.;)

- 3dvisuals dude

Post by ProfessorKhaos // Aug 16, 2007, 1:20pm

ProfessorKhaos
Total Posts: 622
pic
That would indeed be pretty cool! :)


Haven't had much of a chance to work on the script this week but I hope to finish soon.

Post by 3dvisuals dude // Aug 17, 2007, 3:18am

3dvisuals dude
Total Posts: 1703
pic
That would indeed be pretty cool! :)

Haven't had much of a chance to work on the script this week but I hope to finish soon.

I don't mean to rush you at all, I'm just very excited at the possibility of adding what we are discovering now to the awesome things you are doing here for us all. We're MUCH closer to the solution today, so soon hopefully we'll be able to help you take this project to the next level!:)

Thanks for all this ProfessorKhaos,

- 3dvisuals dude

Post by 3dvisuals dude // Aug 17, 2007, 8:33am

3dvisuals dude
Total Posts: 1703
pic
We did it ProfessorKhaos.:banana:

Here's the thread where it happened today:

http://forums1.caligari.com/truespace/showthread.php?t=3900 (http://forums1.caligari.com/truespace/showthread.php?t=3900)

As the character "S.R. Hadden" said in the movie "Contact"...

"Wanna go for a ride?":D

- 3dvisuals dude

Post by ProfessorKhaos // Sep 3, 2007, 12:29pm

ProfessorKhaos
Total Posts: 622
pic
Just thought I'd bring folks up to date a bit.


Still been working on the trackmaker script and I've gotten it to the point where I can begin some mesh construction. It seems to do ok parsing the old file format used with python so hopefully results will be quite familiar.


This weekend I worked on the routine that traces out the track's plan in preparation for mesh creation. Seems to be working fair enough so we're getting close to a final product. The mesh will be a bit of a bear to make but in many ways will match some of the steps I had to do for the cable object project so it's at least familiar territory. Actually, it should be easier than the cable object because the sharpness of the track bending should be somewhat limited so rounded end caps on each segment shouldn't be necessary.

Post by ProfessorKhaos // Sep 3, 2007, 12:48pm

ProfessorKhaos
Total Posts: 622
pic
This is what the track looks like when wired up to the cable's mesh generator. The track's mesh generator will be more versatile, allowing the user to define a track cross section.

Post by Burnart // Sep 3, 2007, 1:19pm

Burnart
Total Posts: 839
pic
Looking good! Can't wait to see balls or carts running down such things. :jumpy:

Post by 3dvisuals dude // Sep 3, 2007, 1:30pm

3dvisuals dude
Total Posts: 1703
pic
This is what the track looks like when wired up to the cable's mesh generator. The track's mesh generator will be more versatile, allowing the user to define a track cross section.

I'm so excited about this I can hardly contain myself!!!!

This is going to be an absolute BLAST ProfessorKhaos!!!!:D

Thanks for doing this.... I'm gonna be busy soon building all kinds of Avatar Cabs to ride on these when you're finished!!!

I can't wait!:banana:


- Mark / 3dvisuals dude

Post by hultek43 // Oct 4, 2008, 1:15am

hultek43
Total Posts: 234
Impressive looking, I couldn't find it :confused:. Did you finish?

Post by prodigy // Dec 14, 2008, 12:41pm

prodigy
Total Posts: 3029
pic
Hey Khaos Excellent project here!! :banana:

How i miss it??? btw. need any help to finish??? :rolleyes:

Don't stop this project please!! :o

Post by ProfessorKhaos // Dec 14, 2008, 4:22pm

ProfessorKhaos
Total Posts: 622
pic
Hey Gang!


Sorry I've been away from trueSpace and many other things for the past few months. I do still have this script buried away somewhere. I based this on an old python script I created an older pre-7.0 version of trueSpace. In this case, the "track" is the same "rope" I also used to create the drooping cable object applied as a standin for the track.


It can be finished at some point and perhaps I can post a working copy of what I have so that others can see how it works. One nice feature built into it is a "file reader & text parser" that could have more than one use. Also, once data is loaded into the file reader it persists so concievably the associated track data could be passed along with the current copy of the object.


Glen

Post by prodigy // Dec 14, 2008, 4:54pm

prodigy
Total Posts: 3029
pic
Great Glen,
Im playing with your rope object.. BTW is Excellent!! :banana:

I made 2 null objects, so now the link nodes are not visible in render..


BTW, Glen, how dificult can be modify your rope to something like this??
16876

Looks like is the same behavior like your script but over a plane instead a cylinder..

Good to have you back! :)

Post by ProfessorKhaos // Dec 14, 2008, 7:54pm

ProfessorKhaos
Total Posts: 622
pic
Bent planes (if there is there such a thing?) would be easy provided a few assumptions are applied.


Essentially you'd use a sagging rope "equation" at each end with an equal number of segments then simply connect the dots. Technically, you could get away with one but if you wanted the flexibility to have one end more folded than the other then two rope "equations" would be best.


Of course there's also mesh normals, uv mapping, etc... etc... so maybe not a total slam dunk but in principle not an extremely difficult job.


It could make for an interesting realtime retractable roof animation with cloth segments folding in upon themselves or for your example above.

Post by prodigy // Dec 15, 2008, 3:45am

prodigy
Total Posts: 3029
pic
Yeap great demo,

So you give the cylinder shape by scrip right? not by mesh or something that could be easy to change right? :confused:

Thanks Glen.. keep in touch

Post by ProfessorKhaos // Dec 15, 2008, 4:54am

ProfessorKhaos
Total Posts: 622
pic
It'd likely use 4 anchor points for adjustment instead of just 2. Then you adjust the slack in the edges. Should be no less interactive than the rope and you could always flatten history to turn it into a final mesh for hand editing.


Come to think of it, 4 rope equations would be better than 2 so that you could have the sag on any edge (or just tighten the edge to make it straight).


Hm, now you got me thinking...

Post by prodigy // Dec 15, 2008, 7:28am

prodigy
Total Posts: 3029
pic
heheheheh...:D
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