Questions about X3Core Library

I’m new to OpenGL, and have followed the Tutorials on www.xojo3d.com. I downloaded the X3Core Library and am using it to my satisfaction.
I found a few typos but they were easy to solve. Something more severe was: a scene on an iMac displayed completely mirrored compared to Windows. Thanks to the tutorials I was able to correct that too, so now both platforms show the same. I don’t think it’s a bug in the Library though. Did somebody notice this also and has any idea what’s causing this?

Until now I was not able to use a (semi)transparent Texture when using this Library. I know how to make a transparent Rectangle, but couldn’t detect a way to do the same with a Texture. Anybody…?

Joop, may I ask what you did to get the mirror issue on iMac fixed?

The place where you need to look is in the X3Texture.Constructor(texture As Picture) method.

The semi-transparent issue is due to the way that the texture is created from the picture data with the following instruction:

mb = texture.GetData(Picture.FormatBMP)

Since BMPs does not contain alpha data, this would be the problem.

Previously we got semi-transparency working by looping through each pixel and creating the texture manually (apposed to using GetData). This is however a very slow method for loading textures.

Unfortunately I don’t have time right now to dig into possible solutions for the semi-transparency issue, since I have a couple of important project launches coming up in the next few weeks.

If anyone else knows of a better way to load the textures into a format that OpenGL supports, while preserving the alpha values, I will happily update the existing code with the changes.

@Alwyn Bester
In X3Graphics class, method drawPicture I added the part before the #Else phrase. It’s the same code as after #Else, just changed the order.

#If TargetMacOS ' JR did this, because on OSX everything gets mirrored...? // add uv-coordinates model.UVMap.Append New X3Core.X3UVCoordinate(u2, v1) model.UVMap.Append New X3Core.X3UVCoordinate(u2, v2) model.UVMap.Append New X3Core.X3UVCoordinate(u1, v2) model.UVMap.Append New X3Core.X3UVCoordinate(u1, v1) // add vertices model.Vertex.Append New X3Core.X3Vector(x2, y2, 0) model.Vertex.Append New X3Core.X3Vector(x1, y2, 0) model.Vertex.Append New X3Core.X3Vector(x2, y1, 0) model.Vertex.Append New X3Core.X3Vector(x1, y1, 0) #Else // add uv-coordinates model.UVMap.Append New X3Core.X3UVCoordinate(u1, v1) model.UVMap.Append New X3Core.X3UVCoordinate(u1, v2) model.UVMap.Append New X3Core.X3UVCoordinate(u2, v2) model.UVMap.Append New X3Core.X3UVCoordinate(u2, v1) // add vertices model.Vertex.Append New X3Core.X3Vector(x1, y1, 0) model.Vertex.Append New X3Core.X3Vector(x2, y1, 0) model.Vertex.Append New X3Core.X3Vector(x1, y2, 0) model.Vertex.Append New X3Core.X3Vector(x2, y2, 0) #EndIf

So far only for Pictures, but the same might count for DrawString?

About transparency: sorry, I really need a fast solution…
Strange thing is, I see several Transparent/Transparency properties, so I thought I just did not tested these well enough. But as I understand from your words, there is more to it.

@Alwyn Bester I know you’re busy but if you have some time again, I like to discuss a few small things that are not clear to me. It’s about this semi-transparent use of textures of course, but I also have a question about Sprites: I can get them working but when I append them to an existing Scene they’re completely out of scale. How to make them appear in the same scale?