Transparency Issue

Blitz3D Forums/Blitz3D Programming/Transparency Issue

PoliteProgrammer(Posted 2006) [#1]
Okay, all of you who helped me out with one of my previous posts, may be familiar with this already.

Basically, I've just loaded a 3ds model into Blitz, and finally got the textures to display correctly, except for one.

The cockpit is supposed to be translucent blue.
But in my model, it is white, and not translucent at all. The other textures work well.


PoliteProgrammer(Posted 2006) [#2]
Bumped because I still need help.


Stevie G(Posted 2006) [#3]
Very difficult to help you here. If that's a free model .. upload it with what you have and we can help.

Some questions ..

Is the cockpit texture separate? Assume it's png or tga format so that alpha is supported? How are you applying the other textures .. via brushes? It may be that you have to set the brushalpha to get this to work before painting the surface.

More info required at any rate ...

Stevie


Gabriel(Posted 2006) [#4]
I already uploaded a copy of the model when he was having problems with converting it. Grab it here

http://www.glimmergames.com/temp/awing.rar

From memory, I think the cockpit is a separate entity, so you could probably just give it a color and set it to 0.5 alpha and it would be fine.


PoliteProgrammer(Posted 2006) [#5]
Here's a link to the model:
http://scifi3d.theforce.net/download.asp?intGenreID=10&intCatID=10&filekey=211&key=126

Just scroll down the page and click the button to download the model.
The files I have are completely identical.
As far as I can tell (i'm quite new to this) the cockpit texture is not included.

I'm not applying the textures at all. All I have is

AWing = LoadAnimMesh("C:\Documents and Settings\James Robinson\Desktop\Stuff\Blitz and Idea\Blitz3D\MY PROGRAMS\Star Wars\Models\A-Wing\a-wing.3ds", playerPivot)
ScaleEntity AWing, 0.75, 0.75, 0.75

and the textures appear automatically except that the cockpit glass is completely white.
Perhaps someone could explain how this happens?
I just took a detailed look at the model and also realised that some of the textures are stretched over the wrong part of the model.


I tried looking at that model, but all my browser displays is some gibberish, which I presumed was machine code. I tried downloading it (I understand that a .rar is similar to a .zip file) and I have a program to open it, but I just get a link to the web page filled with useless code. Is it a problem with my browser? I normally have no trouble with .rar files.


Gabriel(Posted 2006) [#6]
Right click and save as. It'll stop the rar opening in your browser window. Don't know why it does that, but it's probably the way I have my server set up.


b32(Posted 2006) [#7]
You could use FindChild(parent_mesh, child_name$) to find the window. It is probably a separate entity.
AWing = LoadAnimMesh("something.b3d")
AWing_window = FindChild(mesh, "window")

This code will print out the names of all the children:



GfK(Posted 2006) [#8]
There is an entity named "cockpit", but thats the whole top half of the ship, not just the glass.

You're going to have to detach the vertices that make up the glass so that they can be handled as a separate entity. Alternatively, play with vertex colours/alpha.


PoliteProgrammer(Posted 2006) [#9]
@ Gabriel
I already tried that, I just get a HTML copy of the code I said about earlier.


b32(Posted 2006) [#10]
(edit)
When you download the file, for some reason it wants to save it as a .htm. However, if you change the name to awing.rar, it works.

The window is a surface on the child "cockpit"

awing = loadanimmesh("a-wing.3ds")
f = findchild(awing, "cockpit")
surf = getsurface(f, 4)
brush = createbrush(0, 0, 255)
brushalpha brush, 0.5
paintsurface surf, brush



PoliteProgrammer(Posted 2006) [#11]
OMG I can do it now! Thanks for everyone's help. All I needed to do was realise that the children entities had multiple surfaces, and it was easy!

Thanks so much.


Gabriel(Posted 2006) [#12]
I already tried that, I just get a HTML copy of the code I said about earlier.

You didn't need to download it :P

I was linking to it again because Stevie thought he might be able to help better with the model.