[SOLVED] Convert from right-handed coordinate system
-
- Posts: 18
- Joined: Mon Apr 16, 2012 5:04 pm
- Location: Calabasas, CA
- Contact:
[SOLVED] Convert from right-handed coordinate system
Hi everyone, I'm trying to load Quake III .MAP files into Irrlicht, but I can't make it load correctly. While it is rendered ok, all the geometry is flipped horizontally and vertically. Because these files use a Z-up right coordinate system, I thought it would be just a matter of converting to Irrlicht's left-handed Y-up system rotating the X axis (i.e, switching Y and Z axes). But it doesn't work. In fact, doing this doesn't display anything at all.
Do you guys have any suggestions? Thanks.
Do you guys have any suggestions? Thanks.
Last edited by ItsBritneyBitch on Mon Apr 16, 2012 10:05 pm, edited 1 time in total.
Re: Convert from right-handed coordinate system
How are you loading those? I have no issue loading my own maps.
-
- Posts: 18
- Joined: Mon Apr 16, 2012 5:04 pm
- Location: Calabasas, CA
- Contact:
Re: Convert from right-handed coordinate system
Oh...I guess I should've posted this in Advanced Help?
I'm using the algorithm to get the vertices from the planes intersections that I got from a couple of sources. Are you loading .MAPs too?hendu wrote:How are you loading those? I have no issue loading my own maps.
Re: Convert from right-handed coordinate system
Irrlicht loads QIII maps natively (.bsp)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Posts: 18
- Joined: Mon Apr 16, 2012 5:04 pm
- Location: Calabasas, CA
- Contact:
Re: Convert from right-handed coordinate system
Lawl , I think it was quite clear that i'm trying to load *.MAP* files, not BSPs. .MAP is the format used by Quake-like engine editors, like Radiant, WorldCraft or Hammer, where the geometry is stored as the intersection between planes.Mel wrote:Irrlicht loads QIII maps natively (.bsp)
I'm aware that converting coordinate systems isn't rocket science, but again, should I move this to Advanced Help? Thanks a lot.
Re: Convert from right-handed coordinate system
Oh! i see... loading QIII BSP maps is well supported, unlike loading the .MAP files.
Well, The simplest way is to load them, and then, flip them as needed (no coordinate conversion at all...) Only keep in mind that when the faces are flipped, their normals should be flipped too, after.
Well, The simplest way is to load them, and then, flip them as needed (no coordinate conversion at all...) Only keep in mind that when the faces are flipped, their normals should be flipped too, after.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Posts: 18
- Joined: Mon Apr 16, 2012 5:04 pm
- Location: Calabasas, CA
- Contact:
Re: Convert from right-handed coordinate system
I don't know if this can be helpful for someone, but I made it work by inverting every axis and swapping the Y and Z axes. Then use the irrlicht plane constructor with the 3 points using a descending winding order (which sets the face normal), i.e
Code: Select all
irr::core::plane3df myplane(v3, v2, v1);
Swapping axes is part of a coordinate system conversion.Mel wrote:Oh! i see... loading QIII BSP maps is well supported, unlike loading the .MAP files.
Well, The simplest way is to load them, and then, flip them as needed (no coordinate conversion at all...) Only keep in mind that when the faces are flipped, their normals should be flipped too, after.
Re: [SOLVED] Convert from right-handed coordinate system
I think it would be very interesting that Irrlicht supported the loading for .MAP files. Mainly aimed to physics wrappers, because .MAPS are defined by convex brushes, which in exchange, can be very eficiently parsed by physics engines, and i think they can translate almost directly.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: [SOLVED] Convert from right-handed coordinate system
But what would be the advantage of reading map files instead of bsp, which is compiled from the map files and hence has more compact representation.
And yes, can be moved even though it's already solved even here. But no, don't start another topic with the same theme on your own, admins will move your thread.
And yes, can be moved even though it's already solved even here. But no, don't start another topic with the same theme on your own, admins will move your thread.
Re: [SOLVED] Convert from right-handed coordinate system
Yep, the compilation also removes unreachable spaces and does various other niceties. OP, why do you want to load a .map?
Re: [SOLVED] Convert from right-handed coordinate system
I quote you.Mel wrote:I think it would be very interesting that Irrlicht supported the loading for .MAP files. Mainly aimed to physics wrappers, because .MAPS are defined by convex brushes, which in exchange, can be very eficiently parsed by physics engines, and i think they can translate almost directly.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: [SOLVED] Convert from right-handed coordinate system
Yes, I read the post; but I want to hear the OP.
-
- Posts: 18
- Joined: Mon Apr 16, 2012 5:04 pm
- Location: Calabasas, CA
- Contact:
Re: [SOLVED] Convert from right-handed coordinate system
My music is out everywhere!hendu wrote:Yes, I read the post; but I want to hear the OP.
Seriously though, I wanted to load .MAP files cause...*drum rolls*... I'm making a CSG editor (using Irrlicht for rendering), with BSP compiling, PVS and radiosity calculations.
Re: [SOLVED] Convert from right-handed coordinate system
Now that sounds really awesome i recomend you to use Spherical Harmonics for the radiosity storage (Both Irradiance Volumes, and Irradiance Maps). they can be a bit dificult to understand, but it is worth the effort.
So if i get it correctly, what you are going to do is to create the brushes somehow, compile them into a .MAP file, load it and perform all the calculations to create a BSP with portals and all the stuff?
So if i get it correctly, what you are going to do is to create the brushes somehow, compile them into a .MAP file, load it and perform all the calculations to create a BSP with portals and all the stuff?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: [SOLVED] Convert from right-handed coordinate system
Are you writing the compiler yourself, or just outputting .map and using one of the existing ones?