indie_indie's Recent Forum Activity

  • Okay, I wasn't using this right either. I find bugs as soon as I moved the 3d camera. I've searched around for other answers and found one from newt that said to simply use mouse.x and mouse.y position. That also seems to not work. I'm using the ghost racer example and spawning a flash object where my mouse position is, just that it only works when the camera isn't moved and left at default.

    Yes, that's right. If the surface is at z=0 – mouse.x, mouse.y will work correctly.

    I tried changing the Look At Z camera and trying with ground above 0 Z elevation, but that didn't work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Do you like math :D ? You can calculate the position using the angle of the camera...

    or there is already some inbuilt expressions for this:

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/3d-camera

    CanvasToLayerX(layer, x, y, layerZ)

    CanvasToLayerY(layer, x, y, layerZ)

    Transform a position in canvas co-ordinates to layer co-ordinates on a Z plane given by layerZ. This is similar to the system expressions of the same name, but working in 3D.

    LayerToCanvasX(layer, x, y, z)

    LayerToCanvasY(layer, x, y, z)

    Transform a position in 3D layer co-ordinates to 2D canvas co-ordinates. This is similar to the system expressions of the same name, but working in 3D.

    I don't understand what this expression returns. It's just other numbers that also don't match the cursor position in 3D space.

    Okay, in my project I'll try to use all planes with z = 0 and Mouse.x("Layer 1"). Then the created object gets the correct position.

    Maybe in the future I'll figure it out, but for now it's very difficult.

  • Do you like math :D ? You can calculate the position using the angle of the camera...

    or there is already some inbuilt expressions for this:

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/3d-camera

    CanvasToLayerX(layer, x, y, layerZ)

    CanvasToLayerY(layer, x, y, layerZ)

    Transform a position in canvas co-ordinates to layer co-ordinates on a Z plane given by layerZ. This is similar to the system expressions of the same name, but working in 3D.

    LayerToCanvasX(layer, x, y, z)

    LayerToCanvasY(layer, x, y, z)

    Transform a position in 3D layer co-ordinates to 2D canvas co-ordinates. This is similar to the system expressions of the same name, but working in 3D.

    Oh right. I should have checked the documentation first :)

    Thanks! I'll take a look and post the results here.

  • Hello. Does anyone have a formula for calculating mouse click position with a 3D camera?

    The usual methods are not suitable.

indie_indie's avatar

indie_indie

Member since 18 Feb, 2022

None one is following indie_indie yet!

Trophy Case

  • 2-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

4/44
How to earn trophies