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.

collision object with drag&move ?

Home Forums Puzzles collision object with drag&move ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #85848
    NaxosCG
    Customer

    Hello there !

    I need to let the end user to drag&move objects in a 3D scene.
    Is there anyway to define a collision object to limit the drag&move so the draged object does not go outside the scene ?

    If the scene were rectangular, i could use limit puzzle, but what if it is not ?

    Thanks for help.

    "1+1=3... for large values of 1"

    #85852

    Hi,
    You can either use physics for that, or, much easier, just raycast a ray from the object downwards and organize some kind of “navigation map/mesh” below that will constraint your objects. Check out the raycast example in the manual. In your case the raycasting would be done from the individual objects, not the camera.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #85854
    NaxosCG
    Customer

    Hi,
    You can either use physics for that, or, much easier, just raycast a ray from the object downwards and organize some kind of “navigation map/mesh” below that will constraint your objects. Check out the raycast example in the manual. In your case the raycasting would be done from the individual objects, not the camera.

    Hello Alexander.
    As you may remember, i’m far from coder guy. And i have to admit this raycast puzzle sounds a bit too nerdy for me.
    Would you create a simple exemple, with a cube that we can drag&move indise a bigger one ?
    I can’t code / hard puzzle, but i can understand examples and reuse in my own ones.

    That would be a nice Christmas gift ;-)

    "1+1=3... for large values of 1"

    #85859
    xeon
    Customer

    I have tried to cast rays from an object to another object but get nothing but empty arrays.
    It seems no matter what I can only get data when casting from the camera. Any way to get object to object casting?

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #85863

    Merry Christmas!

    It’s actually not very hard to do with puzzles. Please check out the following example:

    Here we have some objects from the “Draggable” group. After the actual dragging happens, we cast a ray in the down direction to the “Map” which is a navigation mesh below the objects. If ray hit happens, the puzzle returns some data in the list, if miss happens the list is empty. If we’re allowed to move, we save actual object position to the “last position” variable if we don’t this position is used to place the object where it should be located.

    I’ve upload the actual project to Verge3D Network, feel free to check out: https://v3d.net/1e87

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #85873
    NaxosCG
    Customer

    Youhouuuuu !! (This is happyness scream in French, but i guess also in english, as Omer Simpson says that a lot)

    Thank you Alexander, and merry Christmas !

    "1+1=3... for large values of 1"

    #85874
    NaxosCG
    Customer

    Works like a charm !!!

    "1+1=3... for large values of 1"

    #85876
    xeon
    Customer

    Seems my mistake was thinking the raycast puzzle was looking for a direction that could be taken from a get object direction puzzle. Perhaps changing the name within the puzzle to object vector would be more appropriate. Once you use a vector all works well….thanks.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

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