Any way to move collision triangles?

Discussion in 'Content Creation' started by Narwhal, Mar 17, 2014.

  1. Narwhal

    Narwhal
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,701
    hello all
    i am creating a map and i have a problem. my collision triangles are not where i need them to be. this is the 3rd time i have restarted because of this. here is a picture of what i am talking about
    screenshot_00093.png
     
  2. sirmattington

    sirmattington
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    3
    Which 3D Modelling program did you use to make the building? I had a similar issue when I started JBeaming the vehicle I'm working on - the node/beam structure would appear away from the actual model. In my case, I was using 3ds Max, and had to follow Fundador's fix here:

    Tutorial-Fix-All-export-problems-in-3DS-max

    If you're using Blender, I believe the fix would be one of the ones listed here:

    Need-help-getting-vehiclepart-ingame

    Basically, you have to center your object to the origin in your 3d program, then re-export, should help with the triangles lining up. Or I could be completely wrong, and this only applies to vehicle models, I haven't tried to make a map yet.
     
  3. Narwhal

    Narwhal
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,701
    ok thanks. i wil center it when i get home
     
  4. NkosiKarbul

    NkosiKarbul
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    438
    What sirmattington said,
    it does not only happen on vehicles but also on static objects. Beside centering the model in 0,0,0, you also should also take a look at orientations being at 0° to the worlds orientation. Not sure but i think last aspect did also cause some misalignment for me.
     
  5. Narwhal

    Narwhal
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,701
    well i centered the origin and now the problem only happens occasionally. the problem is now that i cant delete those collision triangles, even if i delete all the buildings.

    edit
    also this a small problem. if i cycle through the debug menus too much, the game crashes

    UPDATE
    i can rid the triangles by quitting level. now the problem is still the collision triangles are not in right places even after centering. only on one building though. i may just remake the problem building
     
    #5 Narwhal, Mar 17, 2014
    Last edited: Mar 17, 2014
  6. NkosiKarbul

    NkosiKarbul
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    438
    Hm thats strange, the only other source for this i can imagine is the meshs origin is not in the center of all points of the mesh. So rather than the mesh being not centered to the worlds coordinates, the origin of the mesh is not centered in itself.

    Which software do you use, and would you mind to upload a test .dae file in which the problem occurs? Does not have to be your building but created and exported using the same workflow, to recreate the problem obviously.

    Edit: in case you use something different than sketchup, do you use a seperate collision mesh or the visable mesh as collision? In case you use sketchup im feared to know the answer.^^
     
  7. Narwhal

    Narwhal
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,701
    heres what i do. create the mesh in blender, center it, then export as 3d model. then import into sketchup, texture it then export following drowsy's video. then i add it into my level.
    the strange thing is that i did this method with another building and it worked like it was supposed to. ill get a pic in a sec and maybe upload a building

    UPDATE
    heres a pic
    screenshot_00094.jpg

    and here is the building. i dont care if people use it just give me credit
     

    Attached Files:

    #7 Narwhal, Mar 17, 2014
    Last edited: Mar 17, 2014
  8. NkosiKarbul

    NkosiKarbul
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    438
    Yeah well.. sketchup, i hate it!
    I mean what kind of mess of seperate meshes is that inside the .dae? I doubt you did model every shape seperatly inside blender, or did you model a window frame made of a box missing 2 faces and sticked it inside a hole in the wall?

    It hurts me deep inside to read about this workflow! ^^ As i guess you did model it properly as a single mesh object, but sketchup did split it up either on im- or exporting?
    Please learn to assign texture images using polygon selections and/or uv mapping in blender. Modeling in blender and porting it to sketchup to texture it is like having a carpenter building you a 5k pool billard table by hand but then you decide to have it covered in latex rubber by a drunken blind guy, rather than the real cloth. I may be exaggerating here but it is realy not that much to learn if you can already model in blender, but in same time offers more control. Also you could use a seperate collision mesh, which offers you to use less triangles for collision than for the rendered mesh and so save on performance. The windows in the top floors dont need edges in the collision mesh for example, as cars will rarly fly into them i think.^^

    But to come back to the centered origins and coordinates.
    The only "thing" inside this .dae file, that is centered, is the main null/empty called "sketchup", everything else is off center. Allready the second null/empty is around 500 cm off center.
    You want to have the origin of the object centered inside the center of mass of all polygon points, and then have this origin(and so the mesh) centered in the coordinates of the parent object or world if there is no parent object.
    centered.jpg


    In blender you would hit ctrl+shift+alt+c while you are in object mode, to get the "set origin" options window. Inside there you can use "Origin to Center of Mass", this will make the origin jump to the center of mass of the mesh, no matter how the shape looks.
    Afterwards you hit shift+s to get the "snap" menu. Here you can first use "Cursor to Center" and then from the same menu, while having the object selected, use "Selection to Cursor" to make the mesh get centered, as the cursor was in front moved to the center of the world.

    The problem is, that you will probably destroy this by porting the model throu sketchup, as it probably adjusts stuff to handle it in the way it wants to.
    I highly suggest you to learn texturing in blender! Take a look at blender uv texturing or uv unwrapping/mapping tutorials, im sure you can get a hold of it fast. :)
     
    #8 NkosiKarbul, Mar 17, 2014
    Last edited: Mar 17, 2014
  9. Narwhal

    Narwhal
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,701

    i dont know how to texture in blender. i tried once and the texture didnt line up. here is the original .dae though
    also thanks for the other tips
     

    Attached Files:

  10. NkosiKarbul

    NkosiKarbul
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    438
    Ya thats looking more like i expected you to model a house in blender. ^^
    What you mean if you say "tried once", if i tried something once and didnt get it i try it a second time, maybe with a different source for informations. If i still fail to understand this will get repeated till i do. :p
    Use video tutorials on youtube or http://cgcookie.com/blender/ or something else but please men.. you wont regret it! Specialy when you will be able to use normal maps.. you just have to love normal maps. ;)

    Still the mesh was not centered... and there where lamps and a camera with it, you should deleete them from the scene before exporting. Unless the only reason why you had them still in there was that you knew its just for me, but then again you would not have followed the workflow you use while exporting for sketchup as i pleased you to do. Not that important after all as your problems are caused mainly by sketchup imo.

    Here you can see how it should look if everything is centered:
    centered1.jpg
    Note that my program uses a different world orientation than blender, y+ is up, but that makes no difference for the center question, as its just a rotation angle. You dont have to bother with the rotation in blender that much unless you start rotating things on purpose, as blender uses the same orientation as torque3d.

    Checklist:
    1. Origin is centered to center of mass.
    2. Mesh is centered to its parent object. 0,0,0 in the parents space. *[SUP]1[/SUP]
    3. All further Child objects are centered to their own parent objects and the world space, AND have no rotation to world orientation.

    *[SUP]1[/SUP]: Note that every Empty/Null object, used to group mesh objects, has its own space, talking of 3d space/room. This means that you have to center every single mesh and null/empty object to its direct parent until you reach the world space itself. Otherwise you might get failures from something being off center.
    I call them Empty/Null because they are called differently in different porgrams.

    Only if you can check all 3 points, you have removed every source for misalignments in the T3D engine that im aware of.

    PS: Learn dat uv-mapping/texturing in blender stuff plox! In the time we already try to solve this, you could have learned texturing in blender like 2-3 times maybe.
    I am not complaining, if i would not want to help i would just ignore this thread and i was slow with answering, but it hurts to see someone struggle like this for such minor reasons. :/
    *imitates borg voice* "sketchup is futile!" :p

    Edit: Just found this after a little browsing http://cgcookie.com/blender/2011/01/21/intro_uvmapping/
    Or part 2 of this one maybe, http://cgcookie.com/blender/cgc-courses/creating-a-damaged-concrete-column-in-blender/
    but there are many more.
     
    #10 NkosiKarbul, Mar 18, 2014
    Last edited: Mar 18, 2014
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice