ray casting

This is a discussion on ray casting within the Game Programming forums, part of the General Programming Boards category; Originally posted by Shadow12345 I understand that. The thing I don't understand is if octree is necessary if you already ...

  1. #46
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by Shadow12345
    I understand that. The thing I don't understand is if octree is necessary if you already have bsp implemented in your game. I assume it isn't, but seeing as how I don't know the specifics of either i cannot be sure.
    No, you'd usually use either BSP or Octree, not both -- You generally wouldn't want to partition the same level with 2 different types of partitioning. It's a waste of memory and you'd then be working with 2 sets of partitions on the same level.

    One place that you might use octree WITH BSP is with a single level that has both indoor and outdoor environments. You'd partition the insied with BSP and the outside with octree because octree lends itself better to outdoor scenes. It's hard to use BSP outdoors because it's so open -- it makes it makes it problematic to make conves sets and uneccissary because since the level is so open, you CAN see most of it. That's when you'd rely more just on frustum culling without any frustum clipping and use octree instead of BSP.

    But still, you'd mostlikely never use octree and BSP in the same location. That's why it's kind of silly to ask "Is an octree necessary if you use the bsp format?" Both are used for partitioning so if you are using one method for one part of a level you don't want to do it again for the same part with another type of partitioning. It just wouldn't make sense -- there would be no reason. IE Quake does not use octree, it's just BSP.

  2. #47
    Shadow12345
    Guest
    That's why it's kind of silly to ask "Is an octree necessary if you use the bsp format?"
    Well I supposed it is silly if you already know (which I didn't). Realize I already had a hunch you would say something to that effect, and also realize that you are answering more questions than I have asked by that quoted statement, i.e octree and bsp are basically the same thing with several specific differences. What I mean is they both break up the worlds to make the rendering process easier(EDIT: faster). Then there are several specific differences, i.e what each node stores, the the number of nodes in the trees, and what scenarios they are used in.

    Oh and by the way I found a good resource for just reading up on different things like this

    www.gamasutra.com
    I think I spelled that right. Good chance you've already come across it, if not, there ya go don quijote

  3. #48
    Visionary Philosopher Sayeh's Avatar
    Join Date
    Aug 2002
    Posts
    212
    To PolyMorphic--

    I'm not going to waste time arguing with you. It does no good. I've complimented you, I've tried to work with you, all to naught.

    The fact is, you are full of yourself. Your method of BSP tree creation isn't correct at all. It is certainly not standard. If it was you would know that

    a) you didn't start dividing the subspace in the right place,
    b) you are creating sectors that wouldn't be created, and
    c) you obviously don't have a clue because you don't understand vectors and vector normals. All wall segments are described by vectors which represent planes. As such any given vector (or plane in this case) has one and only one normal.

    Since you don't know about dot products and vectors yet (analytical geometry, which falls under applied mathematics), I'll explain the importance of the dot-product to you in BSP trees in games:

    It's necessary so that you can tell which side of a surface you are on.

    When you get to highschool you'll learn about them.
    Last edited by Sayeh; 12-14-2002 at 10:01 PM.
    It is not the spoon that bends, it is you who bends around the spoon.

  4. #49
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by Sayeh
    a) you didn't start dividing the subspace in the right place
    There is no definitive place to split your sectors. If you don't understand that then you dont understand what BSP is -- you can make the split dependant on how many polygons you split, or you can go for a balanced tree, or any number of other conditions. BINARY SPACE PARTITIONING means that you recursively split in twos and doesnt have ANY relation to the way in which you split them. My method splits it based on having near-equal walls on both sides which is what is best in most situations. You could make random splits and it's still BSP as long as it's recursive splits in half. Arguing that "the first split was in the wrong place" doesn't mean ANYTHING AT ALL.

    Originally posted by Sayeh
    b) you are creating sectors that wouldn't be created
    Haha, oh yeah? then point them out. From your previous posts it's obvious that you don't know how to use a BSP tree and how sector data is stored so I'd like to see how you think they are created rather than rambling on about how you think I'm wrong, because I am not.

    Originally posted by Sayeh
    c) you obviously don't have a clue because you don't understand vectors and vector normals. All wall segments are described by vectors which represent planes. As such any given vector (or plane in this case) has one and only one normal.
    Obviously YOU don't understand them, old man. A plane is defined by a normal and it's distance from the origin in unints defined by the normals length. A single vector DOES NOT REPRESENT A PLANE. A single vector is a vector. A plane has a location, a vector does not. You need a normal and distance or else you don't have a plane. It's a very simple concept. Go back to school if you don't get it. Also, a Plane has infinite normals (not 1) and 2 normalized normals (one for the positive and one for the negative direction).

    Originally posted by Sayeh
    Since you don't know about dot products and vectors yet (analytical geometry, which falls under applied mathematics), I'll explain the importance of the dot-product to you in BSP trees in games:

    It's necessary so that you can tell which side of a surface you are on.

    When you get to highschool you'll learn about them.
    Hahahahaha, I think you are losing your memory in your old age, Sayeh. I know vector math, I have created an entire API specifically for vectors, matrices, rotations, scaling, shearing, and a lot more. Dot product is for finding the cosine of the angle between two vectors times the magnitude of each. You don't know what you're talking about. Maybe you've been away from math for too long. I work with this every day, I know what I am talking about. You apparently don't know what you are talking about or perhaps don't remember.

    And I'm in college right now, smart guy. Maybe you should consider going back.
    Last edited by Polymorphic OOP; 12-14-2002 at 10:54 PM.

  5. #50
    Shadow12345
    Guest
    I reread your description, and looked at your drawings again-- which are different from standard BSP. I think your viewpoint is slightly skewed by the way you are implementing your own version of BSP.
    I think it's stupid that you are arguing, keep in mind poly was only demonstrating the most general ideas behind bsp to me, not all of the specific implementation details. This means that, although his 'version' may be slightly skewed of the 'standard' bsp format, the fundamental ideas behind it should not change.

    Correct?

    you both know a lot, you both seem very intelligent, and that's fair, and neither of you will ever be able to prove the other wrong, so you may as well stop (even if one of you is in fact 'right')

    EDIT:
    to sayeh:
    I wanted to ask you a few questions about what you meant, and maybe you could post pictures to explain your point(s) because it seems you have contradicted the resource I learned to get the ideas behind the bsp format. Anyway...
    you are creating sectors that wouldn't be created
    could you maybe edit his bitmaps and explain why they wouldn't be created?

    you obviously don't have a clue because you don't understand vectors and vector normals.
    All wall segments are described by vectors which represent planes. As such any given vector (or plane in this case) has one and only one normal.
    I thought you had to have a triangle (or at least two vectors) in order to form a plane. I thought that a vector could only be found at the origin, that vectors can't really exist in the actual polygons that make up the world because they aren't drawn like other objects that you might find in a game, i.e cars in games can have vectors because they are objects that are first drawn at the origin and then translated to their proper locations, but worlds cannot have vectors because they are drawn 'statically' (dont' know another word) meaning vertices are placed at such and such a location and that the brushes that actually make up the world are never drawn at the origin. I hope I am making sense, I have a hard time communicating exactly what I mean. Or can the term 'origin' be used more loosely, that it doesn't really mean 0,0,0, but rather it just 'originates' from a specific point or something (i.e surface normals used when calculating lights)

    bah I know nothing and I can't even say what I mean and what I mean probably makes no sense, but i've tried

    EDIT2:
    Isn't the dot product a perpendicular 'ray' or 'vector' that 'originates' from a surface or vertex or something?
    or is that the crossproduct?
    EDIT3:
    by sayeh:
    I reread your description, and looked at your drawings again-- which are different from standard BSP
    who determines the standard for bsp, and where can I find a description of it?
    Last edited by Shadow12345; 12-16-2002 at 02:36 PM.

  6. #51
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by Shadow12345
    I thought you had to have a triangle (or at least two vectors) in order to form a plane.
    Correct, you can't make a plane from ONE vector (though a vector doesn't "come from the origin" it just doesn't have a location so it's usually drawn as a ray from the origin). One vector could serve as a normal to the plane, but there are infinately many planes that can have that normal. You need at least 2 vectors, or a triangle, or a normal and a distance from the origin, or something similar. A vector does not define a plane alone. He doesn't know what he's talking about.

    Originally posted by Shadow12345
    I thought that a vector could only be found at the origin, that vectors can't really exist in the actual polygons that make up the world because they aren't drawn like other objects that you might find in a game, i.e cars in games can have vectors because they are objects that are first drawn at the origin and then translated to their proper locations, but worlds cannot have vectors because they are drawn 'statically' (dont' know another word) meaning vertices are placed at such and such a location and that the brushes that actually make up the world are never drawn at the origin.
    Nope, vectors aren't drawn, period. Vectors literally have no position. Just like how an angle has no position. If I said "30 degrees," that contains no information about its location. It's the same concept as with a vector only a vector contains both information abotu angle and magnitude in that direction. They represent the direction and speed of an object, or can represent acceleration, or orientation, or the normal to a plane and other intangeable things. They merely represent direction with magnitude. The only time you'd "draw" a vector would be if you wanted a line pointing out of an object to see its orienation or direction of acceleration, etc. In order to do that you'd have to use the direction of the vector to create a line, so you still wouldn't actually be drawing a vector. Again, Sayeh just didn't know what he was talking about.

    Originally posted by Shadow12345
    Isn't the dot product a perpendicular 'ray' or 'vector' that 'originates' from a surface or vertex or something?
    or is that the crossproduct?
    That's cross-product, correct. You can use the cross-product with two vectors to calculate a common normal to both (or 0 vector if they are colinear).

    Originally posted by Shadow12345
    who determines the standard for bsp, and where can I find a description of it?
    That's exactly the main reason why his whole post makes no sense what-so-ever. Not only did he make no sense with his math, but he also was referring to a "standard" BSP which is non-existant.

    BSP means that you take a 3D world and recursively split it in twos. Nothing else. That's why it is called "Binary Space Partitioning."

  7. #52
    Shadow12345
    Guest
    Well again poly your descriptions describe everything very well, therefore I have no more questions at the moment. Here is a site that has a lot of 3d math.

    www.flipcode.com

    He doesn't know what he's talking about.
    You're both equally bright and arguing is dumb whether one or the other 'knows' what he is talking about in this particular situation. I've heard good things about Sayeh off the board (i.e people wishing they were as good programmers as him) and it would be cool if you two could just respect each other instead of being dorks

  8. #53
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    No no, you're both wrong! A vector is a sector who's polyatomic substructure has become obscure due to either:

    a) The sub-level of x where x is the co-radii of the vector of y IS a vectore

    b) The vector has become a sector to store BSP data into a substructure on polyatomic levels

    You both are dividing sub-poly BSP tree binary vector-sectors in the wrong dimensional bipolar view. First you must understand linear calculus 2.03 class type: vectoramic. You need to split the vector into to polyatomic OOP triangles and then transverse them to the opposite leg of the tree node until you reach the leaf of the "player". Once that is complete, you may continue on with the protomagnomic vectoranis process which is, essentially, a shortened version of Carmack's vector-to-sector mathematics. Also, vectors CAN be drawn. Not on the xyz axis, but on the g axis. If you don't know about the g axis go take a course in astronomical bipolar calculatical dimensia. As for the normals, each vector has n-1 normals in comparison with its negative trasgetic vector. You can make a plane from one vector if you have the grantinomal informational subset. Then after that is accomplished continue on with the segmentation of normal vectors in terms of sectors as stated in binary logic.

    For both of you, go take a class in Geoastronomical Bi-dimesia distortion calculations basic process 101.

  9. #54
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078

    Wink


  10. #55
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    lol was it good mumbo-jumbo?

  11. #56
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Yeah, hehe I'm glad that people still have a sense of humor after all this arguing.

  12. #57
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    first poly, cool it, Sayeh was not attacking you why the hell are you being so defensive.

    allz im gonna say is poly, wtf are you talking about? or do you even know?

    your not the smartest person alive and you certainly don't know everything, you have nothing to prove so stop trying.

    and don't bother asking, my point is made already.

    edit:: please think a little before you argue with people with 20+ years of JUST programming experience on you, show a little respect.
    Last edited by no-one; 12-17-2002 at 04:49 AM.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  13. #58
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by no-one
    first poly, cool it, Sayeh was not attacking you why the hell are you being so defensive.

    allz im gonna say is poly, wtf are you talking about? or do you even know?

    your not the smartest person alive and you certainly don't know everything, you have nothing to prove so stop trying.
    Why? Because for 4 months I worked nonstop at making a BSP engine. I ate, slept, and breathed partitioning. Prior to that I worked for a couple of months on a math engine solely for 3D oriented programming and physics. For several months after, I spent time making a skeletal model system.

    Specifically, in this thread, someone asked for an explanation, so I gave it to them. Not only that but I took the time to diagram out an example process of partitioning.

    When Sayeh starting spewing out nonsense saying I was wrong, when I wasn't, I defended myself. My first reply to his post did not intend to be an attack on him, though I was extremely annoyed considering the only thing he could have possibly accomplished from it was creating more confusion. If he had disagreed with me and actually backed it up with ANY logic at all, I would have had more respect for him. Instead he took one or two sentences to say I was wrong, and in the little explanation he gave he used false mathematics or he commented on a non-existant "standard." Very little of what he's said has any credibility. The point of the example was to clarify things for people reading the post and all he's done is confused other people with his nonsensical ranting.

    Programming has become my life, specifically 3D oriented programming. I'm not saying I know everything as I definately don't, however, this is my homeground and I know it very well. Excuse me if I get "defensive" when someone starts talking about me being wrong when they obviously have no experience on the topic of BSP (or at least it would appear so from his "points"), or even general linear algebra.

    Originally posted by no-one
    edit:: please think a little before you argue with people with 20+ years of JUST programming experience on you, show a little respect.
    And I did have respect for him -- until he had to go and post a personal attack against me in a completely unrelated thread.

    I entered the discussion with respect for Sayeh, but when he started showing that he had no respect for me, then I took it personally. I enter with a respect for everyone here, but when someone does something as dumb as that, they ruin it. If he had been a little bit more intelligent with his responses or if he had not taken it to another post, then I would still have that respect for him which I once had.

    Unfortunately, that was not the case...
    Last edited by Polymorphic OOP; 12-17-2002 at 07:42 AM.

  14. #59
    Shadow12345
    Guest
    Why? Because for 4 months I worked nonstop at making a BSP engine. I ate, slept, and breathed partitioning. Prior to that I worked for a couple of months on a math engine solely for 3D oriented programming and physics. For several months after, I spent time making a skeletal model system.
    dammit i need to get my head out of my ass and start really working!

    Do you get assigned these types of projects at your school (I know you said you did the bsp over the summer)

  15. #60
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078

    Unhappy

    No, in an attempt to keep newer programmers from getting intimidated and dropping out, they only allow us to do ascii-based games first year

Page 4 of 5 FirstFirst 12345 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help designing a recursive function.
    By broli86 in forum C Programming
    Replies: 3
    Last Post: 07-24-2008, 01:45 PM
  2. Casting
    By morvick in forum C++ Programming
    Replies: 2
    Last Post: 06-18-2007, 12:06 AM
  3. Ray tracer and collision detection
    By hdragon in forum Game Programming
    Replies: 31
    Last Post: 01-19-2006, 11:09 AM
  4. question about casting pointers/other types also??
    By newbie02 in forum C++ Programming
    Replies: 3
    Last Post: 08-07-2003, 06:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21