May 06, 2024, 07:24:59 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Change the skin of an object.

Started by J B Wood (Zumwalt), August 16, 2006, 05:22:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

How do I switch the material used on a 3dmesh?
I need either a C3DMesh::SetSkin("FILE") or a C3DObject::SetSKin("FILE")

Something like that, I want to overlay a skin on the terrain dynamically.
(think of weather)

Ionic Wind Support Team

I assume your talking about the textures.

mesh.LoadTexture(TextureNum, filename, transColor);

Now a material is a different subject. D3D Materials are a set of colors that control the reflection of light.
Ionic Wind Support Team

J B Wood (Zumwalt)

Ah thanks for replying, I'll need to do that later on the water when I assign it.
I might have to break up my terrain into quadrants since my resulting image is in 4 pieces. that or I use photoshop :)

J B Wood (Zumwalt)

crap its tiled, I just want the 1 image to go over the enitre terrain, not tiled...
is there a flag for that?


// Load our terrain
m.Load3DS(s,GetStartPath() + "media\\map\\terrain.3ds",false);
m.Scale(1,1,1);
m.Position(0,-7.5,0);
m.Rotate(0,45,0);
m.EnableLighting(false);
m.UseVertexColor(false);
m.LoadTexture(0,GetStartPath() + "media\\map\\terrain.jpg",0);

Ionic Wind Support Team

It would have to be the same size as the original texture.  The texture coordinates set in the model editor determine what parts of the texture are used for each vertex.
Ionic Wind Support Team

J B Wood (Zumwalt)

Hrm, It is the exact same size as the mesh.
Maybe... I might have clicked of triangulate all faces, let me play with it some..

kryton9

Nice screenshot, the snow looks refreshing after the hot day today.

J B Wood (Zumwalt)

Thanks, I'll update the code after I get the terrain to map its texture correctly.
I am tempted to use his internal terrain generator, I just haven't figured out the list of parameters.
Paul can you throw me an early instruction bone on the C3DLandscape?
I'll probably have to start a new project just to test terrain generation out, need to learn it some day.

J B Wood (Zumwalt)

Ahh Fixed it. Looks MUCH better now, and the link is updated with latest code, this is now up to 9 megs for everything...

John S

Looks great Z!

You should create a post with this screen shot and link to the exe on Coding Monkeys.
John Siino, Advanced Engineering Services and Software

kryton9

Wow, amazing to get that look so early in the game with Aurora's engine and your super effort!

J B Wood (Zumwalt)

Thanks you two. I don't plan on dropping anything on coding monkeys for this project until I have it as a finalized demo.
Meaning the mech will have basic AI to chase the tank and do object avoidance, along with trying to destroy the tank, and the tank having the ability to fire and keep track of damage and such, its just to early to drop this anywhere but here.

Once this demo is completed, I am hoping it will be a boon for Paul to sell Aurora to more Indies like myself :)
Never rush the boiling of an egg, you will end up with bad yoke if you do.

Steven Picard

Wow!! I like the looks of it.  Add some bump mapping and it'll look sweet!