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.

jdock

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • in reply to: Cloning and Picking #37473
    Avatarjdock
    Customer

    Correct – I believe just the object name will work. A few post in this thread I show how I modified the visual_logic.js to get it to work. I believe what I did there just returns the name, not the actual js object. This workaround works, but I want to avoid editing the visual_logic code if possible.

    Thanks,
    Jon

    in reply to: Cloning and Picking #37468
    Avatarjdock
    Customer

    Yuri,

    Is there an issue if you added the functionality to the ‘when clicked’ event to return the mesh object name in PickedObject even if it is not the target of the When Clicked event? I know it is not the intent of the When Clicked, but it was how it worked prior to 3.5.

    If this is not possible, maybe some help developing a ‘Get Picked’ puzzle. The issue is really for projects like mine where a lot of cloning is involved and an elegant way of interacting with the cloned objects is needed. Basically I need a puzzle to just return PickedObject no matter what mesh is picked. This avoids creating a bunch of When Clicked events for each clone. I used conditions based on the mesh name to determine actions. If you are careful with the mesh names (like using a . at the end of the name) the clone name is predictable.

    Thanks,
    Jon

    in reply to: Cloning and Picking #36849
    Avatarjdock
    Customer

    Yuri,

    I tried something slightly different. If you look at the visual_logic.js content and go to the function initObjectPicking function inside registerOnClick, this changed from 3.4 to 3.5:

    if (!isPicked) {
    _pGlob.pickedObject = ”;
    cbIfMissedDo(event);
    }

    if I change this to as it was in 3.4, any intersected object from the mouse event gets returned with PickedObject, but isPicked remains false:
    if (!isPicked) {
    _pGlob.pickedObject = objName;
    cbIfMissedDo(event);
    }

    I changed this in the visual_logic.js and it works as before. Any chance this could be put back into 3.5? If not, I can just remember to tweak it.

    Thanks,
    Jon

    in reply to: Cloning and Picking #36789
    Avatarjdock
    Customer

    Yuri,

    I have having difficulty getting the ‘code puzzle’ to work with the 3D embedded. I have the 3D window in an iframe with an id = 3dFrame. I seem to be getting the correct mouse coordinates, but the raycaster doesn’t seem to intersect anything. Any ideas?

    Here’s my attempt to refer to the embedded window height and width:
    `// Built-in variables: app, v3d, VARS, PROC
    var mouse = new v3d.Vector2();
    var raycaster = new v3d.Raycaster();
    var x = document.getElementsByName(‘3dFrame’);
    mouse.set((VARS[‘mouseX’] / x.innerWidth) * 2 – 1, – (VARS[‘mouseY’] / x.innerHeight) * 2 + 1);
    raycaster.setFromCamera(mouse, app.camera);

    var intersects = raycaster.intersectObjects(app.scene.children);
    if (intersects.length > 0) {
    VARS[‘temp’] = intersects[0].object.name;
    } else {
    VARS[‘temp’] = null;
    }

    Jon

    in reply to: Cloning and Picking #36549
    Avatarjdock
    Customer

    OK, so I did find a workaround: The attached puzzle worked (not in the preview window though). The code in the ‘Exec Script’ puzzle is:

    // Built-in variables: app, v3d, VARS, PROC
    var mouse = new v3d.Vector2();
    var raycaster = new v3d.Raycaster();
    mouse.set((VARS[‘mouseX’] / window.innerWidth) * 2 – 1, – (VARS[‘mouseY’] / window.innerHeight) * 2 + 1);
    raycaster.setFromCamera(mouse, app.camera);

    var intersects = raycaster.intersectObjects(app.scene.children);
    if (intersects.length > 0) {
    VARS[‘temp’] = intersects[0].object.name;
    } else {
    VARS[‘temp’] = null;
    }

    This returns the name of the mesh if hit, or null if not.

    Thanks,
    Jon

    Attachments:
    You must be logged in to view attached files.
    in reply to: Cloning and Picking #36541
    Avatarjdock
    Customer

    Yuri,

    I gave this a try. I created a list called ‘AllObjects’ and added all mesh objects to it. I have attached the puzzle where I add any new cloned objects to the ‘AllObjects’ list. It seems the When Clicked event does not see the change to the list. It looks like the event only pays attention to the contents of the list when it is initiated – correct?

    Thanks,
    Jon

    Attachments:
    You must be logged in to view attached files.
    in reply to: Cloning and Picking #36487
    Avatarjdock
    Customer

    If the ’empty when clicked’ approach is bad, maybe some guidance in creating a custom event handler that just returns the mesh name from any click?

    in reply to: Cloning and Picking #36485
    Avatarjdock
    Customer

    Here’s 3.5

    Attachments:
    You must be logged in to view attached files.
    in reply to: Cloning and Picking #36483
    Avatarjdock
    Customer

    Here are the two versions. CloneTest.zip if from 3.4, CloneTest35.zip is from 3.5.

    Attachments:
    You must be logged in to view attached files.
    in reply to: Cloning and Picking #36419
    Avatarjdock
    Customer

    Thanks guys – browser cache did not seem to affect the behavior, but a good thought.

    Yuri, I know this is an odd approach, but in 3.4 and prior, the picked object always returned the mesh name. I put an example of 3.4 with this puzzle attached. Check out the console output. I was careful to name the original mesh Cube.0 so the clone name would be predictable (Cube.1, Cube.2, etc.). Here’s the 3.4 example: https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:091950d814/applications/CloneTest/CloneTest.html
    Here’s the exact same in 3.5: https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:ff74dcf89a/applications/CloneTest35/CloneTest.html

    Just updating the project after upgrade to 3.5 does not affect the behavior, but changing a puzzle and saving does.

    Again, if this is a terrible approach, I am open to other ideas to be able to capture click events of cloned objects. Here’s my production project that involves a lot of cloning: https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:ff74dcf89a/applications/ShoreStationDock/index.html

    Perhaps a custom routine? I’m not a great coder, so I’d need help:)

    Thanks,
    Jon

    • This reply was modified 4 months ago by Avatarjdock.
    in reply to: Get the ID of Select Option #32707
    Avatarjdock
    Customer

    Worked perfectly. Thanks!

    in reply to: Get Rotation and Set Rotation in 3.3.0 #30932
    Avatarjdock
    Customer

    Great – thanks for the quick response!

    I am a little new to Verge3D support – should these issues come to the forums, or should I email them to tech support?

    in reply to: Camera Size & Screenshot #27534
    Avatarjdock
    Customer

    Yuri,

    Thanks for the reply – the issue is not being able to switch cameras, but changing the size of the camera. If I resize the window containing the 3DSection and perform a screen shot, I get an image with an aspect ratio of the window. I am curious if there is a blender or camera setting to change the aspect ratio through a puzzle or javascript.

    Thanks,
    Jon

    in reply to: Dock Builder #26541
    Avatarjdock
    Customer

    Thanks for your help! :good:

    in reply to: Dock Builder #26459
    Avatarjdock
    Customer

    Thanks Yuri! I can honestly say your system made developing this a rewarding experience. I’m an (old) engineer, not a developer, so some of the programming and html techniques are a bit foreign. I will definitely work on the compression and on-demand loading you suggest because some users have complained about load time. I assume I can put some sort of progress bar element to allow the user to know the component is loading if it causes a delay?

    I have 3 quick questions:

    1. I am creating a ‘share url’ with three parameters to basically pass enough information through the url to build the complete dock configuration. The URL can get a bit long and I notice on some phone messaging (iPhone), the url gets split into two messages, so the complete parameter is not passed. Is there some magic method you know of to ‘compress’ the url? Here’s an example url:

    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:ff74dcf89a/applications/ShoreStationDock/index.html?Accy=accy.DA0124,14.59,-5.46,0,-90~accy.DA0124,12.12,-5.46,0,90~accy.da0123,12.49,-2.93,0,180~accy.DA0095,14.57,5.48,0,0~accy.DA0094,12.13,5.48,0,0~accy.DA0094,9.7,5.48,0,0~accy.da0017,14.59,-3.03,0,-90~accy.ADAS-6,11.61,-1.12,0,-135~accy.da94-99,7.27,-0.62,0,180~&Depth=18~&Dock=60~..,4,1,6,8,360,Y,Y~0.1.6,4,2,2,8,270,Y,Y~0.1.3,4,1,2,8,90,Y,Y~2.1.2,4,1,3,8,270,Y,Y~

    2. The AR mode is working pretty well, but the model does tend to ‘slide’ while the user walks down the dock. Perhaps it is just my environment and the size of the model, but I am curious if you have any methods to improve ‘tracking’.

    3. Is there a way for me to create a ‘section plane’ that would cut the model at the water line when entering AR mode? I have found some techniques in Blender to do this, but nothing that can work ‘on the fly’. This would help give the dock the appearance of being in the water when in AR mode. I’ve tried turning on a plane to represent water. It works, but it takes away from the ‘real’ imagery.

    Thanks again!
    Jon

Viewing 15 posts - 1 through 15 (of 15 total)