GameMonetize Posted January 5, 2016 Share Posted January 5, 2016 Demo here:http://www.babylonjs-playground.com/#83MVD#0 Quote Link to comment Share on other sites More sharing options...
²Digitalgames Posted January 5, 2016 Author Share Posted January 5, 2016 Thanks Deltakosh. Thats pretty cool ! How do i use it inside a function ?// Mouse Over and Out Function action var mouseOverUnit = function(unit_mesh) { console.log ("mouse over "+unit_mesh.meshUnderPointer.id); console.log (unit_mesh); if (unit_mesh.isPickable = true) { console.log (unit_mesh); var geometry = unit_mesh.geometry.copy('new_geo'); var outline = unit_mesh.clone(); outline.geometry = geometry; console.log(outline.geometry); outline.flipFaces(true); outline.scaling = new BABYLON.Vector3(1.05, 1.05, 1.05); outline.material = redMaterial; outline.visibility = 0.5; }This does not work. The console says 20:01:05.316 TypeError: unit_mesh.geometry is undefined1 FinalScene.js:43:21This is of course i don´t know what i am doing and walking inside darkness trying to find a light switch Edit : I found it , i erased .source from unit_mesh.source etc. I did not notice it because unit_mesh.isPickable did work. Will write back after testing around Quote Link to comment Share on other sites More sharing options...
²Digitalgames Posted January 5, 2016 Author Share Posted January 5, 2016 Hm, thats not what i wanted to do. It scales up the mesh, and that does not look well in this situation. (As shown below on the attached picture) // Mouse Over and Out Function action var mouseOverUnit = function(unit_mesh) { console.log ("mouse over "+unit_mesh.meshUnderPointer.id); console.log (unit_mesh); if (unit_mesh.source.isPickable = true) { unit_mesh.source.renderOutline = true; unit_mesh.source.outlineWidth = 0.0025; unit_mesh.source.renderingGroupId = 1; } }; var mouseOutUnit = function(unit_mesh) { console.log ("mouse out "+unit_mesh.meshUnderPointer.id); console.log (unit_mesh); if (unit_mesh.source !== null) { unit_mesh.source.renderOutline = false; unit_mesh.source.outlineWidth = 0.0025; unit_mesh.source.renderingGroupId = 0; } };This worked. I will post a full code sample later on for other users that wanted to archieve something like this. Thanks for all the help. After all i think i now have all the basics that are needet for my small projects. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 6, 2016 Share Posted January 6, 2016 Excellent! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.