Anim8or Community

General Category => General Anim8or Forum => Topic started by: argo34116 on October 16, 2015, 05:23:30 am

Title: A Matter of Proportion?
Post by: argo34116 on October 16, 2015, 05:23:30 am
I have a .3ds model of a spacecraft that I imported into Anim8or and added textures to(I had to invert the textures on the wings). When I added the model to Celestia 1.6.1 everything was good except the markings and lettering on the wings. When viewed in Anim8or the markings are in the proper place,but in Celestia they are cut off. It appears the size is the issue. What do I do to have the craft appear the same as they do in Anim8or?
Title: Re: A Matter of Proportion?
Post by: selden on October 17, 2015, 04:13:23 pm
I have to admit I haven't encountered this particular type of error. A possibility that occurs to me is that the wings are composed of multiple meshes and the surface texture is only being applied to one of them.

Can you provide a zip containing your files so I could inspect them?

Alternatively, can you provide more details about the surface texture image (size, dimensions, format) and the model (size, number of vertices, number of meshes)?

3DS models have quite a few limitations. You might want to consider trying my CMOD export script, which is available at http://www.classe.cornell.edu/~seb/celestia/modelling.html#4.1

What graphics hardware do you have?

Some cards can only use surface texture images which have sides which are powers of two. Celestia is supposed to be able to rescale non-conforming surface textures so they're usable, but that's relatively recent code and could be buggy. You might try resizing the surface texture image so that (for example) its dimensions are 1024x1024 pixels.
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 18, 2015, 07:26:51 am
The textures are JPG files 1425X1164. I am running Celestia 1.6.1 on windows 7 with AMD A6-3410 MX APU with Radeon HD Graphics 1.60 GHZ. Thank you for your response and your offer to assist me
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 18, 2015, 07:29:16 am
Here are some of the textures.
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 18, 2015, 09:36:40 am
Here is the whole thing. Images and LWO
Title: Re: A Matter of Proportion?
Post by: selden on October 18, 2015, 06:27:00 pm
Unfortunately, when I try to import your model into Anim8or, it complains about a missing LWOBJ. I don't have LightWave.  What version of it do you have installed? (I'm assuming that's what's needed.)

Can you provide the .an8 file?
Title: Re: A Matter of Proportion?
Post by: RudySchneider on October 18, 2015, 07:37:43 pm
Yes, indeed, it's a LightWave model:
Title: Re: A Matter of Proportion?
Post by: selden on October 18, 2015, 07:47:44 pm
Well,  this is the Anim8or forum. :)

I managed to import the LWO into Blender and export it as OBJ. (Format conversion is about all I ever use Blender for, I have to admit. It's way too complex for me.)  No surface texture images were associated with the materials in the model's .mtl file, so they have to be associated manually in Anim8or. The .obj model loaded into Anim8or as a single mesh with no subgroups, which is going to make for more manual work.

I used Anim8or's material menu to associate the wing surface textures with appropriate materials, but the textures were not oriented properly so far as Anim8or was concerned: the wings were drawn solid grey. See the 1st image below.

In "Point Edit" I selected the Right Wing's surfaces and used the UV tool to scale and position the surface texture for the Right Wing. See the 2nd image below.

I then exported the model as a CMOD and created the directories and SSC file that Celestia wants. Although the model was drawn, the wings were transparent. Apparently the PNG images have transparency enabled. As a quick fix, I converted them to JPG images since JPG doesn't support an opacity channel. Now the top of the right wing looks OK. See the 3rd image below.

I'm not sure what problem you were encountering, but certainly managing to get the model into Anim8or with the correct format is a stumbling block.

Title: Re: A Matter of Proportion?
Post by: argo34116 on October 19, 2015, 11:15:57 am
Here is a bottom and top view as seen in anim8or (I converted the file to 3ds via online converter before using it in anim8or and then just added the textures to the model)
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 19, 2015, 11:21:09 am
.....And this is how it appears in Celestia. The idea is that I want the model to appear in Celstia as it does in anim8or. I also want to create three hammerheads flying in formation. I copied and pasted the model,but still get the problem with wing markings,etc. As you can see here
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 19, 2015, 11:28:32 am
Is there anyone out there who can correct this problem and provide the proper .cmod,textures,etc here for me? when I used the textures I had to convert them to .jpg format before I used them. It looks great in anim8or, but does not come out that way in Celestia. Thank you all for the imput so far.
Title: Re: A Matter of Proportion?
Post by: selden on October 19, 2015, 07:33:14 pm
Which online converter did you use?

One of the problems with the model is that it includes 89866 vertices. The 3DS format can't handle more than 64K vertices per mesh, which is why I used OBJ as an intermediate format. My suspicion is that the online service only partially converted the model, so Anim8or can't properly apply the surface textures.

Have you tried rendering the model in Anim8or rather than just looking at the preview provided in the object editor? Rendered objects sometimes can look quite different. The image shown by the editor's preview is optimized for editing, not to be visually accurate.

As I wrote previously, if you can provide the .AN8 model file (in a zip, just as you did the lwo files), I can try taking a look at it.
Title: Re: A Matter of Proportion?
Post by: selden on October 19, 2015, 08:52:21 pm
I downloaded and installed the trial version of Lightwave 2015-3. (It's full-featured but expires after 30 days.)
It was able to read the .lwo file and export it as an OBJ. It could not export it as 3DS for two reasons:
1. the model included thousands of polygons which had more than 3 vertices. 3DS only supports triangle polygons.
2. after using Lighwave to convert them to polygons with 3 vertices (triangles), the resulting model contained more than 64K vertices.

I then imported the OBJ model into Anim8or. Although Anim8or didn't load the surface texture images, the materials were properly associated with the various sections of the model. When I specified which wing textures to use, Anim8or showed them properly. (I only did the wings. I didn't want to take the time to specify all of them.) See the first screengrab below.

I then exported the model as a CMOD. Celestia showed the wings properly. See the second screengrab below.

As I wrote previously, I suspect the problem is with the 3DS model created by conversion site that you used.
Title: Re: A Matter of Proportion?
Post by: selden on October 19, 2015, 09:30:32 pm
I edited the OBJ's .MTL file that was created by Lightwave to replace all of the "/" by "\"  (Lightwave used Linux directory syntax) and .tif and .png by .jpg. I used Imagemagick's convert command to converted all of the .tif and .png images to .jpg format and put them in the same directory with the OBJ model.  Anim8or now loads all of the surface textures automatically when it loads the .obj model. See the first screengrab below.  (Neither Anim8or nor Celestia understand TIF format. Using JPG also avoids the unwanted transparency problem.)

I then exported the model in .CMOD format. Celestia now shows the Hammerhead fully textured. See the second screengrab below.

I then created a Celestia "Addon" out of it. It's in  SAAB_HAMMERHEAD.zip below.

And finally, I zipped the .an8 model file. It's in hammerhead-lwo-an8.zip below. Only the model file is included, not any of the surface texture images.

I hope this helps.
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 20, 2015, 07:23:21 am
Thank you soooooo much for your work. It looks great. Can you create a group of three flying in formation? Is there a way to import .cmod into anim8or? I also am not very comfortable with the process of exporting as .cmod seems complicated.
Title: Re: A Matter of Proportion?
Post by: selden on October 20, 2015, 10:51:44 pm
Here's a Celestia SSC catalog which defines three hammerheads using the same model. (If you want them to have different livery, you'll need to create separate models referencing different surface texture images.) The orbital parameters of HH_001 are identical to the ones used for the ISS in Celestia, with a slightly different MeanAnomaly so they're chasing it. The positions of HH_002 and HH_003 are defined relative to HH_001.
Code: [Select]
# three hammerheads chasing the ISS

"HH_001:hammerhead" "Sol/Earth"
{
Class "spacecraft"
Mesh "hammerhead-lwobin.cmod"
Radius 0.00625                  # length: 11.5 m, wingspan 12.5m

    EllipticalOrbit {
        Period          0.064176392
        SemiMajorAxis   6767
        Eccentricity    0.0016886
        Inclination      51.5684
        AscendingNode   343.1518
        ArgOfPericenter 346.2476
#        MeanAnomaly      13.8216
        MeanAnomaly      13.821
        Epoch           2452028.18381755
    }

    BodyFrame {BodyFixed { Center "Sol/Earth/ISS"}}
    FixedRotation {
      MeridianAngle 90
  Inclination -90
  }
   
    Albedo       0.10
}

# place other spacecraft at fixed positions relative to first

"HH_002" "Sol/Earth/HH_001"
{
Class "spacecraft"
Mesh "hammerhead-lwobin.cmod"
Radius 0.00625                  # length: 11.5 m, wingspan 12.5m

# location
    OrbitFrame { BodyFixed { Center "Sol/Earth/HH_001" }}
    FixedPosition [ -0.015 -0.015 0 ]

# rotation
    BodyFrame { BodyFixed { Center "Sol/Earth/HH_001" }}
    FixedRotation {}


Albedo       0.10
}


"HH_003" "Sol/Earth/HH_001"
{
Class "spacecraft"
Mesh "hammerhead-lwobin.cmod"
Radius 0.00625                  # length: 11.5 m, wingspan 12.5m

# location
    OrbitFrame { BodyFixed { Center "Sol/Earth/HH_001" }}
    FixedPosition [ 0.015 -0.015 0 ]

# rotation
    BodyFrame { BodyFixed { Center "Sol/Earth/HH_001" }}
    FixedRotation {}


Albedo       0.10
}

Unfortunately, there's no CMOD importer for Anim8or. You'll have to learn how to use the CMOD exporter. I tried to make the instructions on the modeling page as explicit as I could. Just follow them "to the letter". Briefly: specify the location of your Anim8or script(s), select the cmod exporter in Anim8or's export menu, concatenate the file's two pieces, place it in Celestia's "models" subdirectory.

Alternatively, you could try cutting the Hammerhead model into several pieces (in Anim8or) so each component mesh is smaller than the 3DS 64K limit. Then you could export them as a single model from Anim8or in the 3DS format. The pilot model looks relatively complex, so maybe making the cockpit separate (as it was in the TV show) would be sufficient.

Below is a screengrab showing the Hammerheads chasing the ISS. Note how dark they are. This is because the model's materials definitions all explicitly specify a base color of 50% grey. To change this, you'd have to modify them all. It might be easier to edit the OBJ .mtl file appropriately (it's just a text file), so I'll zip the obj model and include it below. You'll also have to change the locations of the texture files that're specified in the .mtl file, since you won't have them in the same directory that I have them in.
Title: Re: A Matter of Proportion?
Post by: selden on October 21, 2015, 12:04:37 am
Yup, I was right. Cutting the hammerhead model (roughly) in half allows Anim8or to export it in 3DS format. The forward part of the fuselage is a relatively simple tube, so it was easy to break it in two.

Unfortunately, 3DS models use a different coordinate system when imported to Celestia, resulting in different positions and orientations. *shrug*

Below are a screengrab and  hammerhead-pieces.zip, which contains the sliced .AN8 model, the exported 3DS model and a revised SSC. (No textures are included.)


 
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 21, 2015, 05:07:51 am
Isn't there a way to have a model in anim8or and copy and paste to create a group of three then export it and add it to celestia? I have done this before with a battlestar galactica colonial viper with success. Where can I get instructions on how to add the cability to export to cmod with anim8or? I have a program to convert 3ds to cmod. It seems that it would be less complicated to copy and paste in anim8or to create a group then use that model in celestia versus all the extra steps to modify the ssc file.
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 21, 2015, 11:32:38 am
The fact is that adding the ability to export in anim8or as cmod seems above my understanding and capabilities. I am very much a newbie when it comes to the world of 3d modeling and I do not feel comfortable with it.

If someone could provide me with a model of three ships in formation in a cmod format (Copy and paste to create the two others in anim8or,then export as a cmod for use in celestia) That would be great. I can then create a ssc file of my own and place them as I want in celestia.

Thank you for your patience and assistance from a novice 3d modeler still learning.
Title: Re: A Matter of Proportion?
Post by: selden on October 21, 2015, 12:16:09 pm
The only way you're going to get comfortable with modeling is to do it. Don't be afraid to try things. You won't break anything. "Undo" is your friend. (Ctrl-Z).

The commands to copy-and-paste models and their components in Anim8or are the same as for text editors in Windows:
Ctrl-A = select all
Ctrl-C = copy to clipboard
Ctrl-V = paste to window
Then you can drag them wherever you want.

 The CMOD export script and the instructions for installing and using it are at the URL I posted previously:
http://www.classe.cornell.edu/~seb/celestia/modelling.html#4.1

Unfortunately, the combined model of the formation of three spacecraft is too large for me to upload.

The advantages of describing spacecraft in an SSC catalog instead of making a model containing several of them are
a) the resulting "Addon" is that much smaller, making it easier to share with others (e.g. I couldn't upload it to this forum)
b) when using the smaller model, Celestia is smaller and runs faster, and
c) when you use SSC catalogs, you can specify as many as you want in whatever formations you want, and make them do different things, e.g. fly in formation for a while, then separate on different missions
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 21, 2015, 08:22:34 pm
ok. I followed your link. I assume that is the script that is required to get anim8or to export .cmod. I understand that I have to click on file, then select configure. What is the deal though with the page that the link led me to? Do I have to copy and paste using a editor like Notepad ++ ? Then what do I save it as? What file extension do I use? How do I set it up so that I can click file then configure in anim8or? or is there something different I need to do? I wish that anim8or had this built in so there is no need to do this in such a roundabout way. Perhaps this can be done in a later release of anim8or? So models can be exported as .cmod? It seems like .cmod is used frequently and this should be built into it. Maybe someone can come up with a way to provide a installer that would add this to anim8or?
Title: Re: A Matter of Proportion?
Post by: Claude on October 22, 2015, 01:18:03 am
selden

I was wondering why you were not going
twice through all the shapes.
The first time to extract all the materials.
The second  time to extract all the meshes.

Maybe I'm missing something.

Claude
Title: Re: A Matter of Proportion?
Post by: selden on October 22, 2015, 02:47:16 am
Claude,

I didn't do that *because* it would have required two passes, and wasn't obvious to me how to reinitialize the shape pointers to get back to the start. Concatenating the files is relatively easy, so I've never bothered to figure that out.
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 22, 2015, 05:40:03 am
Here is a group of three hammerheads that I created in anim8or. Just need to figure out how to convert to .cmod I have included it here as HHS
Title: Re: A Matter of Proportion?
Post by: selden on October 22, 2015, 07:25:43 pm
None of them have any surface textures associated with them. Is that the way you want them to be?
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 23, 2015, 05:51:31 am
Use surface textures from other posts, but here it is again. Thank you for your help
Title: Re: A Matter of Proportion?
Post by: selden on October 23, 2015, 10:25:16 am
herewith.
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 25, 2015, 05:55:36 am
Thank you soooooo much Selden. They look great. I have another question though. I have a add on for Celestia that displays the battlestar galactica viper mkII. I copied the ssc file "hammerheads chasing the ISS" and modified it to make a group of three Viper MkII and placed them in orbit around Rigel with the craft from the Galactica TOS add on. It worked great, but the models exhibit a jumpy motion when displayed. What is causing this? Can it be fixed. Otherwise they look great. I have included the file below with both the original and the revised ssc.
Title: Re: A Matter of Proportion?
Post by: selden on October 25, 2015, 03:56:53 pm
It's because you've got them on an orbit which is very tiny, orbiting rapidly, and inside the star.  An orbit which is appropriate for going around the Earth doesn't work well for going around a star. If you specify a larger orbit, one which places the spacecraft outside the star, they won't jump around.  e.g.

    EllipticalOrbit {
    Period 1
    SemiMajorAxis 1
    }

This is just an example to make it display well. A period of 1 (year) at a distance of 1 (AU) is only correct for orbits around our own Sun.  Rigel is a much more massive star, so orbits around it have much shorter orbital periods for orbits with a given semimajor axis.  If you want it to be more realistic, you'll need to do some research and a little algebra to define an orbit which has more appropriate parameters for this star (at a larger SMA so the pilots don't cook, for example :) ) and with the correct period for that SMA.

However, this isn't a topic directly related to Anim8or, so it might be more appropriate to discuss it in a PM (Private Message).
Title: Re: A Matter of Proportion?
Post by: argo34116 on October 26, 2015, 09:28:05 am
Sorry. Thank you though. That did the trick
Title: Re: A Matter of Proportion?
Post by: selden on October 30, 2015, 04:45:32 am
selden

I was wondering why you were not going
twice through all the shapes.
The first time to extract all the materials.
The second  time to extract all the meshes.

Maybe I'm missing something.

Claude

I'm sure you'll be glad to know that I finally managed to modify the export script to do two passes so that now only a single CMOD model file is exported. There's no longer any need to concatenate two files together.   The revised script is available and described at http://www.classe.cornell.edu/~seb/celestia/modelling.html#4.1