![]() |
Re: BSP file: a couple of question linked to geometry
Hello!
Is it possible to correctly shift planes? If so - how to do this? I need to shift the clip-planes so that their distances was the same distances of the point-hull planes. I do so: Code:
const Math::Vector3D hullSizes[Hull_Total][2u] = Please help. |
Re: BSP file: a couple of question linked to geometry
My guess is that what you implicitely want is to shift FACES.
Shifting their supporting planes does not work if the face and its plane have opposite normals, which cannot be always avoided. I think it is not possible to get a proper thickenning of the world based on PLANES alone. You may want to have a look at Zoner's Half-life tools ( qcsg and qbsp i believe) to see how they do it. But actually, the right way to do that is by performing a tweaked Minkowsky sum of the hull and the map. |
Re: BSP file: a couple of question linked to geometry
Hello SamPlay!!
Thank you for helping! Quote:
Quote:
|
Re: BSP file: a couple of question linked to geometry
Quick google: http://mathworld.wolfram.com/MinkowskiSum.html :)
|
Re: BSP file: a couple of question linked to geometry
I read it but did not understand how this relates to the clip-planes - sorry :(
|
Re: BSP file: a couple of question linked to geometry
Me too. :D
|
Re: BSP file: a couple of question linked to geometry
How does Minkowski sum relate to collision? : google for"Minkowski sum bsp".
Almost all references on the first page are interesting. I am using it to (re)create bsp's for hulls (obviously..) different than the "point-hull". After thought: maybe "minkowski sum collision" would be better... |
Re: BSP file: a couple of question linked to geometry
Quote:
1. the point-hull bsp provided in the bsp file, as opposed to the 3 others bsps ( human, head,..) is used in HL for drawing, not for movement( ie collision detection); so some clipping ( blocking) faces are not taken into account when building the point-hull bsp tree because they are not drawn. I assume you want a COLLISION bsp tree for the point and not a DRAWING bsp tree; so you use one of the other bsp trees as a starting point ( because it takes clipping faces into account), and "moving back" its (clipping) planes so that the "thickness" resulting from the hull is reduced to zero, reducing implicitely the hull to a point. Is that right? If it is right, I do not see how you can guarantee that you will get all the original planes. As regard your code, I cannot see how the code itself can be right in some cases and wrong in some others. I mentionned FACES instead of planes because in general the normal of a clipping plane alone cannot tell if the SOLID ( or move-blocking if you wish) side is in front of the plane or in its back. On the contrary, the "contents" data of a face always describes what is in its back ( but the face normal maybe equal or opposite to its supporting plane one). My conclusion is that your code is right ( providing plane.distance has the right signing!), but you make an assumption on the meaning of the plane normal relative the SOLID side which is sometimes right,sometimes wrong. EDIT I forgot: your code is ok in principle but there is a tweak in the way the bsps are build: the planes are actually shifted horizontally by a CONSTANT value, as if the hulls were vertical CYLINDERS. |
Re: BSP file: a couple of question linked to geometry
Quote:
Quote:
Thanks for the detailed response! Code:
//add the offset non-axial plane to the expanded hull Maybe is possible to find 'origin'(also known as point0 for computation hull plane normal) from code above by some equation - if possible? :) |
Re: BSP file: a couple of question linked to geometry
well if you do
'origin[0]-=' instead of 'origin[0]+=' , you should get what you are looking for. Now that I understand your goal, Minkowski sum will not help you! Zhlt should have use it instead of their code you show, and the problems mentioned in the top comment of zhlt code would not haved occurred ( when creating and displaying faces from non-pointhull bsps, it really looks silly!). Also, forget about the EDIT ( about 'vertical CYLINDER'), it is a mistake. |
All times are GMT +2. The time now is 14:44. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.