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.

Placing objects clicking instead of dragging

Home Forums Puzzles Placing objects clicking instead of dragging

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28836
    Angel del Amo
    Customer

    Hi all,

    I’ve placed objects on a scene giving coordinates, and then let the user to drag the objects to the correct place of a plane. But I’m trying to have the objects placed directly by the user in the desired position by the client (that is, by clicking in the plane). Is there any way to get x y z position of the place where the mouse is clicked on an object?

    also I’m looking in the js reference examples, to see if it can be done with raycast… but in this moment any of the webgl examples are working for me, browsers console give the error “v3d is not defined”…

    thanks in advance!

    #28908
    Angel del Amo
    Customer

    Hi… any help with this would be really appreciated.
    Are the webgl examples webs working for you correctly? I can only see backgrounds in all of them, and I’ve tried in chrome-firefox-edge on different pc- laptops…

    https://cdn.soft8soft.com/demo/examples/index.html

    thanks!

    #28925
    GLiFTeK
    Customer

    Hi,
    First, if the places they the user can click the object to are specific, or on a grid, you can make invisible (transparent clip material) objects then use “snap to object puzzle”

    Second, if it’s any pixel on the screen they can put it then I’d try the client X and clientY options in the “on event of” HTML Puzzles, use in”body” and get target value to retrieve the coordinates to put in the “set object” (position to.
    Mouse clientX clientY

    Hope that helps
    (I’m doing same thing :good: )

    #28932
    Angel del Amo
    Customer

    Thanks for your answer GlifTek… at this moment I was trying with pagex pagey, fixing the camera in a top view. But depending on the size of the client’s area its more or less accurate.
    for now, it’s enoguh for me, but I would like to have also working in first person view for furniture placing… I would like to have a try with raycaster, as in the NASA vechicle demo. Could you kindly please confirm me if Verge examples web is working for you? https://cdn.soft8soft.com/demo/examples/index.html#webgl_geometry_terrain_raycast For same reason its not loading for me…
    thanks!!
    best regards!!

    #29021
    GLiFTeK
    Customer

    Haven’t checked your link yet (will when I’m at desktop)..

    Here’s some more info I posted on grid snapping if you haven’t seen…

    Link to grid snapping explanation

    :good:

    #29023
    Angel del Amo
    Customer

    Thanks Gliftek… link to examples are working again, I’ll see if I can advance with raycast to place things at intersection point and let you know (Im newbie with js, just 3d knowledge).

    Alsto thanks for the grid explanation, I’ll look to it right now

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