We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Physics – creating solid walls with camera as first-person view.

Home Forums Puzzles Physics – creating solid walls with camera as first-person view.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #12975
    YvonneD
    Customer

    Hi all,

    I’m having trouble creating solid walls. I would like to make it so the camera using “first person” controls can walk through a build (i.e. a house) and be confined to the room dimensions. I am using Blender 2.8.

    1. I believe this requires the camera to be kinetic and the wall objects to be static. (this does not work). side note..I do know that if I make the camera dynamic I fall through the floor so physics is turned on.

    2. I have tried attaching a sphere to the camera (camera a parent) too. No joy.

    3. I have followed the physics example and NOT added any rigid body constraints in Blender, but used the puzzles. I have also tried using the Blender 2.8 rigid body physics system. Still no joy.

    4. I do a lot of 1 prim building so the wall/floor system is all derived from one cube. Is this an issue?

    I don’t mind hard coding …just not exactly sure how to accomplish this within Verge3Ds file system or code using ammo.js. Any examples someone can offer?

    Is there an example of Verge3D using the camera as first person with physical walls? Any help is greatly appreciated. I have a large number of 3D Website Worlds I would like to convert to this system, but physical walls are mandatory.

    Thank you in advance!

    #12979
    elk
    Customer

    Have you had a look at the First Person Camera, search for it in the 2.10 release post;

    Verge3D 2.10 for Blender/3ds Max Released

    It is not based on the physics system, but you can set up a material that the camera controller will snap to making it a walkable surface, and you will not be able to go outside it, the one thing that is missing for my needs is that if you have multiple floors you will get snapped down to the first floor if you go of the edge of the second floor. The team has it in there TODO list, and hopefully it will make it in by the 2.12 release. Check out the City example in your applications folder to see a bit how it works. If you need it to behave more physical, like jumping or falling and stuff you might want to go for physics yeah. I have not sett that up for anything yet, but if its more of a ArchViz project you got, i think the first person camera is really nice. Someone else or the Verge3D will surely have some more insight on setting up physics if you need that. Hope this was helpful.

    #12982
    YvonneD
    Customer

    Thanks Elk!

    I am using the Verge3D plugin to export the GLTF from Blender in first-person view, so that part is working great. I will definitely take another peek at the city example.

    Thank you for the suggestions. I had considered forcing a pathway to walk. The rooms are rather small with interactivity so perhaps that would work. Unfortunately just setting up the screen space wouldn’t work because of the internal walls. As a last resort, however, I suppose I could separate each room into a different page and “teleport” them as they walk through a doorway. Seems like a lot of work for that though and interrupts the immersion experience. :unsure:

    I am looking to convert a large number of 3D worlds (incorporating the avatar in this conversion is another challenge to conquer :wacko: )…so I chose a rather large project for testing.I mention because…it has more than one floor! argh :D

    Thank you again for the suggetsions and fast response.

    #12987
    elk
    Customer

    All I did to keep from walking through walls was make a mesh with a dedicated “collision material” where i cut the mesh where there is supposed to be walls (see attached image) you can also make the mesh incline for stairs or hills, but you will be dropped downstairs if there is overlap once you pass the edge of the second floor. Once exported it will not render by default i think(or you might just need to disable the render button in the outliner for it), so you can tweak it to not follow the visible enviorment. But if you need avatars to not go through eachother and have more “physical” collisions you would have to do it with physics yeah. I just find the First Person camera so easy to work with for my need that I thought I would mention it. Good luck with your project :good:

    #13002
    YvonneD
    Customer

    Thanks Elk! Sounds like your solution works, but not sure I understand.

    Would you be so kind to outline the steps? Do you make this mesh a rigid body in blender? Or is this the item you mentioned “snapping” to the camera?

    Really appreciate your input.

    #13004
    elk
    Customer

    Sure. I made a quick demo;

    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:53632680b5/applications/test_first_person/test_first_person.html

    Se the attached image for the setup in blender, I tried to mark the sections and options you need to look for.

    The things you need to set up is as follows;

    In the camera properties under Verge3D Settings, change the camera to First-Person.

    Then make a new mesh object, model it to cover the areas you want to be able to move to, the green mesh in my demo.

    Then you create a material that will be used only for this purpose, I just made it green to make it stand out, but it doesn’t really matter because we can hide the mesh object from being rendered in the exported scene anyway, just toggle of the camera icon for the mesh object.

    Back in the camera settings again you need to select the collision material you just made in the Collision Material field.

    Place your camera above the mesh, if not you will float a bit while moving until you are above the mesh and “snap” to it.

    That is basically it, press “sneak peak” to check it out.

    I set up the demo with a blue wall, as you can see there is a hole in the green mesh under the walls, and that is what is stopping you not the wall itself, I keep a bit of distance so the camera wont clip into the wall if you stand too close, but that depends on scene scale and camera settings so play around to find the way you like to set it up. Also i made a little second floor to demonstrate the “falling of” i mentioned, if you go to the edge with the first floor under you you see you get snapped down to the first floor, as I mentioned; hopefully they will get that implemented soon, but i already think this is a great camera mode, and so easy to set up really.

    Of course you would put your objects around to get the visuals, the collison mesh is never meant to be seen. So no physics engine used, and if you did want to go that route you would also need an invisible collision mesh for that and that would also need the walls in it, not just the floor element like this setup.

    A bit of a long post, but i hope this help you out.

    #13070
    YvonneD
    Customer

    Thank you Elk!!!

    Sincerely appreciate the time you took to do that. I had missed the “collision material” field and probably still would have stumbled a bit without your detailed explanation of the separate material. I managed to get it to work on a very small file :yahoo: :yahoo: …now to see what I can do with the house. :scratch: :scratch:

    #13071
    elk
    Customer

    No problem. Glad you found it useful :good:

    #31313
    abin
    Customer

    could you solve the collision on vertical walls? (wondering)

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.