![]() |
|
Spaces home Paul Gausdens' spacePhotosProfileFriendsMore ![]() | ![]() |
Paul Gausdens' space3D Canvas programming and Models
|
|||||||||||
|
6/25/2008 FSX Attach Tool for 3D CanvasAnother small step closer to full FSX support in 3D canvas. I now have a working attachment point editor. It has 2 modes of operation, selecting a face on an object will add a new attachment group and object on or above the face. Selecting an object will convert the group containing the object into an attachment. All it does internally is create an XML string into a Group Custom field. This is then exported as PartData in the X file on export. Adds the following XML to the new group containing the small purple pyramid in the image below. <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_smoke"><AttachedObject> <Effect effectName="fx_SmokeStack2.fx" effectParams=""/> </AttachedObject></Attachpoint></FSMakeMdlData> It still requires a little more work on validation but it works for now. This just leaves export of bone parameters in to the X file as the last major job - then it's on to some proper testing. 6/6/2008 Back from across the pondI spent the last few weeks in Montreal and New York visiting family. No time for programming or 3D models but I did manage a little research.
I made it to the canadian rail museum Exporail. Lots of large (compared to UK) locos and an A4 class "Dominion of Canada" hidding in a corner of one of the sheds. In need of a little paint - here is a photo of the cab interior:
We drove from Montreal to New York with a stop at the Old Rhinebeck aerodrome - what a great collection.
It was a great shame I was too early for the weekly airshows, but I did get a small demo as they tested the Caudron which did a short hop along the field and back. What a fantastic sound that rotary engine made.
3/13/2008 A break from Trains1/15/2008 More Instant ArtWhen I first showed my Train Sim Engineer plugin to Adrian Woods and Pete Zahn of ACEs they used the phrase "Instant Art" to describe the generation of a few thousand polygons in a few seconds.
Here's another plugin I've just written that also builds geometry.
On selecting a face, it takes 4 parameters, inset from the edge, height, width and number of facets
There is also an option for the type of object to be generated: rivet (cone) or nut (prism)
The result is a rivet or nut object at every corner, equidistant from the two edges that make the corner.
The same plugin can be run 3 times on the same face to produce washers, nuts and the bolt ends: Lots of polys 1/8/2008 Smooth12/24/2007 A "Quick" Cab - and the development of a new Canvas OperationStill time for one more before Christmas.
A while ago I wrote a Cab builder plugin.
You simply enter a few dimensions for the size, curve height and overhangs and it automatically generates a box with a curved roof. So that part is easy. I took the dimensions from the plan, as mentioned in the pervious blog post, and filled in the form (dimensions in metres)
Ta-da! A cab with a lovely curved roof in a few seconds.
Then I hit a problem.
Being a bit of a stickler for straight edges, I couldn't think of an accurate way to move the points that make up the roof edge to match the plan. Shown below (I applied a translucent material to the roof so the plan could be seen) Ideally the points needed to be "sheared" or I could shift them by hand - but that could lead to inaccuracies.
Then I had an idea - I vaguely remember back to my days of experimental physics at university. There was a method of finding the best straight line through a set of points of one axis was known accurately, which the X axis (left/right) is in this case.
A bit of a search threw up the Least Squares method - http://www.che.udel.edu/pdf/FittingData.pdf
I put this algorithm into a small program that takes a set of selected points, a fixed axis and a variable axis which then processes them into a straight line.
The result is a new operation button for 3D canvas.
From the plan view, I dragged the points, restricting them to Z axis only movement (hold down the Z key) (I did exaggerate the zig zag for illustrative purposes, normally I would be a bit more accurate when shifting points) Select the points and run the operation, selecting the "Align Z, X fixed" option.
The result is a mathematically straight line - no human error. 12/19/2007 Straightening scanned plans and working out their pixel scaleLooks like I do have a bit of time to do one or two more blogs...
When you scan a plan from a book, 99.9 times out of a 100 they are not perfectly straight.
Using a paint program it is a relatively simple process to fix this. It is also a good idea to work out the pixel scale for the image.
This can then be used to get unlisted dimensions from plans by using a pixel tool in a 2D paint program. First load up your image. My paint tool (the rather ancient Picture Publisher 8) has a pointer tool that lets me mark out a rectangle on an image without drawing anything.
The status bar shows the start coordinates and the width and height of the box.
Most locomotive drawings show the rail top as a line. Using one end of this line as a start point I draw the rectangle to the other end of the rail top line.
In the example below (red rectangle) it shows I have a height of 25 and a width of 2965.
I then start up the most useful application in Windows - the calculator.
Make sure it is switched to Scientific view.
Divide the height by the width:
25 / 2965 = 0.0084317032040472175379426644182125
Then click Inv and press Tan
Inv Tan = 0.48308955972084815380076833108458
This is the number of degrees that the image must be rotated by.
I then select the rotate by arbitrary amount option in my paint program and enter 0.483 degrees (anti-clockwise)
Now we have a horizontal plan, I pick a known dimension from the drawing, In this case the 32' wheelbase.
This is 1532 pixels wide. This translates to 1523/32 = 47.59 pixels per foot
or the other way up (32 * 12) / 1523 = 0.2521 inches per pixel
and multiply by 2.54 to get to centimetres per pixel = 0.6404
So now, if you measure 10 pixels on the drawing you know it is 10 * 0.2521 = 25.2 inches or 64cm
I usually mark this information directly on the drawing that way it never gets lost - provided you remember to save the altered image file. 12/18/2007 Christmas & stuffMost of my new N gauge train set has arrived and christmas is fast approaching. It's the season to take time off from the train sim hobby... Not
I'll try and sneak in a bit more programming and modelling whilst I'm off work.
Here's one I did yesterday - 7500 polys, for that! My first model using the new extra high poly wheels.
You can see the full size image in the picture gallery.
Anyway if I don't type anything before, *************** Happy Christmas everyone ***************. 12/6/2007 PluginsI've been busy programming the FSX plugins this week, fixing a few bugs and adding the attachment tool.
I've also been reviewing the future of the TS Engineer plugin.
I have changed the materials generated for the wheel rim to make those polygons easily selectible (by material)
I also incorporated a couple of extra faces to the flange profile to make it a bit more accurate.
Here is a sample of the output:
This is starting to build a serious number of polygons - the pacific wheelset, using a 40 sided rim, generated over 9000 polys for the wheels alone. 11/30/2007 Knuckle CouplerI'm used to making chain link couplings for UK Steam rolling stock, but with the tutorial I thought I'd do a bit of research and experiment with a knuckle coupler.
I found some good drawings of an ARA 'D' type in a 1920's cyclopedia of US steam (CD Rom from PI Engineering)
What an awkward shape! I've been working on and off for several days using boolean intersections and subtractions. Welding points where 3DC was not totally accurate, consolidating and optimizing.
I finally ended up with about 400 polys of coupler (Will probably aim for less in the final version) I suspect that's not too bad considering some chain couplings I've made were similar poly counts.
It is probably worth the detail as that is part of the model that people tend to watch very closely.
I'm quite pleased with the result.
I can now add this to my library of parts.... 11/23/2007 Tutorial 3a - Deck and ChassisOn with a bit more model making. This time the decking and chassis.
First - study the plan and photos. Mike managed to get photos of the real thing, I also have a source of original photos for this particular model, including a few good colour (color
Looking at the plan it seems I need a central rectangle. I can then extrude out the sides of this rectangle twice to get the side decks and extrude the ends
to give me the front/rear platforms by the steps. From the photos and plan, it looks like there is a chassis extending down to just above the wheels. The decking is probably very thin and there is a small (about 4") side plate around the edge. For the decking I start by dragging a cube primitive onto the scene.
Check the hierarchy and may sure the new cube group is a child of the main group - this will help with accurate positioning later. I right mouse click on the cube. Select "Scale -> To Size" and scale it to the size I need.
Right click again and select Properties. Change the X and Z coordinates for the group to 0. This should make the primitive central on the model if the hierarchy is correct.
Now in the perspective view, right mouse drag the decking to the correct vertical position (watch the side view pane)
To start the series of extrusions, hold down the Ctrl Key and select both sides of the box.
Click on the Extrude Operation button on the left menu
If you have the 3DC main panel set up to show the object history, you should now see a parameter adjustment panel for the extrude just below the operation buttons.
Make sure both option boxes are checked and adjust the extrude size by looking at the plan view pane.
Repeat the same procedure for the second width extrude.
Now with the 2 sides selects, hold down the Z key (to restrict movement) and use the scale tool in the side orthographic view (bottom right of the viewport) to add the angle by the steps.
Repeat the 2 extrudes for the ends of the cube.
Now I'm going to delete the vertical sides where the steps go down (8 faces in total) and all of the underside faces.
By running the DoubleSide operation on the whole object, I end up with a deck with 4" side sheets.
I now select a few of the underside faces. This can sometimes be difficult after running the double side operation (3DC bug) - an invert operation usually lets you select them.
We then extrude down about 0.5m (1.7ft) and there we have a very nicely shaped chassis and deck.
(A Consolidate operation will then reduce the polygon count a little)
The Cab comes next ..... 11/15/2007 Tutorial 2 - The hoodCatching up with Mike - without the video. This is going to be a long blog....
It was a bit hard to see exactly what Mike did on his video, but here is my interpretation.
1. Starting with the Extrude object tool - use the mouse to drag this onto the scene.
2. This starts up a new window with 4 panes. Click on the little vehicle icon and select the side elevation plan.
This tool is not the easiest thing to use, but the general idea is to draw the outline. Don't worry if the image you're using isn't square, it will be scaled correctly afterwards.
I start with a click in the bottom left corner and click to add the first point above it.
The square at the end of the line appears white.
Click on the end of the square again so it turns blue - otherwise the extrude tool will do a bezier spline between all the points. Basically just work your way around the section, making sure all the points are blue and that the X and Y coordinates match for vertical and horizontal lines. The points can be dragged around the scene and you can zoom in for fine adjustments. The last point doesn't need to be blue, it just needs to be placed exactly over the first point (the green one)
Finally add a horizontal line in one of the other panels to give the object some thickness.
Click on the save button and close the window to return to the main screen.
3. First I selected a 30% transparent blue material and used the fill tool.
The new object needs to be positioned and scaled - I select the face that is going to be along the centre line and run my shift centre operation (square with blue X button) Note - the Extruded object was created in a group that is a child of the Main group. I then set X value of the object position property to zero. (right click object/properties) This should centre the edge of the object relative to the main object.
I can now change to 2 or 4 views (menu View/Selection). Using the orthogonal side view, use the position and scaling tool on the lower right of the window to make the object fit over the plan.
4. Switching to 4 view I can now select the outside face in the perspective view. With the "X" key held down, to restrict the movement to the X axis, I can now use the front/rear view drag tool (bottom right) to make the object the correct width. (My plan isn't cropped correctly)
5. Next I select the 3 top outside edges (Hold down the ctrl key, use edge select tool on right) and drag down the Y axis of the object modify widget to put a slope on the engine hood.
6. I select the front vertical edge of the lights, I can hold down the Z key and use the top view to shift the edge back a bit to add the front angle over the headlights.
7. With the same 3 edges selected from 5, I run the chamfer operation. You need to watch this one - sometimes in 3DC, the points need adjusting. I had to move the highlighted point in the image below down a bit.
8. With more "modern" models I would probably select the 2 new edges and chamfer them again to give an even smoother curve.
9. Ditto with the front vertical edge. I had a similar problem with points after the chamfer and had to make a few adjustments (I can feel a new plugin coming on, possible with multiple chamfer options!)
10. Finally I had to flip the object on the X axis before mirroring it on the X axis as the mirror only works one way. (This also removes the internal face)
I also ran the consolidate operation to remove a few extra polys from the flat faces. And here it is with a solid texture applied. Canvas does not use smoothing groups - instead, for an object, angles over a set value are smoothed automatically.
New 3D Canvas versionForgot to add there's a new version available 7.0.2.3 from http://www.amabilis.com/whatsnew.htm
Big performance enhancements in several areas. The 3D Canvas User InterfaceBefore I start the next part of the tutorial I think I'll write a bit about the 3D canvas user interface as it is quite
different to the other tools out there and takes a bit of getting used to.
A lot of people coming from other tools generally have a hard time controlling the view and objects.
The type of item selected is controlled by the top two tools on the right hand menu bar object mode or face/edge/point mode
Multiple selection can be achieved for face/edge/point mode by holding down the ctrl key. The next thing to mention are the "widgets".
In the perspective view these appear as 3 coloured axes with shaded triangles and as 2 axes in the orthogonal view.
The widget on the bottom left left controls the view point in the scene.
Dragging the mouse over the triangle on the left widget adjusts the view position.
Dragging the mouse over one of the axes on the left widget changes the view angle. There is also a rectangular "zoom" area next to this widget. Another (simpler) way to control the view is to drag an object with the middle mouse button (or mouse wheel) held down. This
rotates about the selected object axis. Middle mouse dragging over the base grid zooms the view.
The widget on the bottom right or the viewport applies operations to selected objects/faces/edges/points. This widget has 2 triangles per pair of axes. The triangles nearest the axes join/centre controls the position of the selected object/face/edge/point in the selected plane.
Similar move operations can be applied to the selected item using the left mouse button drag on the scene for the X/Z plane and the right mouse button drag for the Y plane.
e.g. select the top face of a cube and right mouse drag to move it up.
The outer triangle controls the scale of the selected o/f/e/p in the selected plane.
Dragging the mouse on one of the right widget axes, rotates the selected item.
It really takes a bit of time to get used to these widgets and they are also affected by the orientation mode (buttons on the top menu) so it is worth taking a bit of time to practice these on simple objects to see what they all do. 11/9/2007 Sleepless...in Seattle!
It was good to meet up with Mike and some of the other Aces team this week.
However it dos mean I'm going to be a bit behind on the tutorial until I get back to the UK on Tuesday.
An interesting Devcon, pity I'm not allowed to say anything about it.
I now have much more detailed plans for the switcher and Tim C gave me some close up photos of a real one, so hopefully I'll be able to make a reasonably detailed model now.
|
||||||||||
|
|