• Content Count

  • Joined

  • Last visited

About Klaas

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi! i have to admit you are right. That doesnt seem to be the problem in my scene. But the code fixed the problem !?!?! I've tried to reproduce the problem in PG, but it doesnt show up. Now im more convinced the problems lies in the LOD and multimat system. But ... look here http://test.pixotron.net/submeshbug/submeshbug.html when you turn around an navigate the materials get pretty mixed up.
  2. Hello! I discovered, what i call a bug, with instances and frustum culling. When the original mesh got submeshes the submesh culling of the instances relate to the position of the original mesh. This results in disappearing instances (submeshes) when the original mesh leaves the frustum. My quick hack was BABYLON.SubMesh.prototype.isInFrustum = function (frustumPlanes) { if( this._mesh._isAllwaysInFrustum )return true; var boundingInfo = this.getBoundingInfo(); if (!boundingInfo) { return false; } return boundingInfo.isInFrustum(frustumPlanes); }; //then setting orginalMesh._isAllwaysInFrustum = true; I think the current behaviour is not intended.
  3. Sounds awsome! I would totaly love to see Multiple Render Targets, wich is part of WebGL 2. Making modern deferred Lighting possible! Keep up the good work!
  4. Hi max, have a look here .. http://www.babylonjs-playground.com/#ZHDBJ#3
  5. Hi, its rotation, not position anymore. Camera Z rotation is roll ... a loookAt has no roll component.
  6. Hi alexolotl, babylon replaces the material when rendering the depthpass for a shadowmap. Therefore your vertex shader did not apply on the shadow pass. Currently babylon has no method to assign custom depthMaterial (but it would be a nice to have) The only way by now would be to customize the shadowGenerator class and the shadowVertex shader.
  7. Hi JCPalmer, have a look here. I used the code from the abstractMesh lookAt function and it works nicely. http://playground.babylonjs.com/#MUVYP#2 Is this what you where looking for?
  8. Hi! Well that looks as if its working nicley. The somewhat wierd degree value of yaw come from this line .. var yaw = -Math.atan2(dv.z, dv.x) - Math.PI / 2; at the end (-Math.PI / 2) the yaw value is turnt by 90 degree clockwise. At this point you have to insert the yaw offset of the viewer. Wich is the default direction of the facing.
  9. ... hm, take a look here or here the shading on the upper legs and the collarbone is not correct. You use blender? There is an option to show you the normals. http://sugarandcyanide.com/blog/2013/01/01/normals-display-in-blender-2-6x/
  10. Hi, how about that ... http://playground.babylonjs.com/#MUVYP#1 ... the position of the dummy is a reference to the spheres position. As long you dont assign a new position object it will work. When you want to revert from the sphere as target you just make a copy of the position to the dummy position.
  11. Hi, i just ran in a very similar problem. Maybe this can help. targetFrontality( target ){ //get the directional vector from viewer to target var d = viewer.position.subtract( target.position ); d.normalize(); //generate a heading vector for the viewer, here the viewer looks along the z axis in positive direction var v = new BABYLON.Vector3(0,0,1); //now calculate the directional vector of the viewer from the rotation of the viewer var c = QuaternionMultiplyVector3(viewer._rotationQuaternion, v); c.normalize(); // the dot product projects one vector on another // 1.0 = heading strait on // -1.0 = heading strait away return BABYLON.Vector3.Dot(d, c); } QuaternionMultiplyVector3 (quat,vec) { var num = quat.x * 2; var num2 = quat.y * 2; var num3 = quat.z * 2; var num4 = quat.x * num; var num5 = quat.y * num2; var num6 = quat.z * num3; var num7 = quat.x * num2; var num8 = quat.x * num3; var num9 = quat.y * num3; var num10 = quat.w * num; var num11 = quat.w * num2; var num12 = quat.w * num3; var result = new BABYLON.Vector3(0,0,0); result.x = (1 - (num5 + num6)) * vec.x + (num7 - num12) * vec.y + (num8 + num11) * vec.z; result.y = (num7 + num12) * vec.x + (1 - (num4 + num6)) * vec.y + (num9 - num10) * vec.z; result.z = (num8 - num11) * vec.x + (num9 + num10) * vec.y + (1 - (num4 + num5)) * vec.z; return result; } if you restrict d and c on axis you can calculate the compontents
  12. ... old but gold! This is a nice one and should definitly go into Vector3 or Queternion Class.
  13. Hi, maybe you are searching for a way to extrude 2d shapes into 3d objects. Have a look here: http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion and here http://doc.babylonjs.com/classes/2.4/Mesh#static-extrudeshape-name-shape-path-scale-rotation-cap-scene-updatable-sideorientation-instance-rarr-mesh-classes-2-4-mesh-
  14. Hi joshcamas, im pretty sure the problem is in the skeletton-mesh. The way the artefacts look (z fighting surface) i assume doubled triangles with wrong normals. With doubled triangles i mean there are two sets of triangles on top of another.
  15. Hi amo, look, this is the source to lookAt() ... public lookAt(targetPoint: Vector3, yawCor: number = 0, pitchCor: number = 0, rollCor: number = 0, space: Space = Space.LOCAL): void { /// <summary>Orients a mesh towards a target point. Mesh must be drawn facing user.</summary> /// <param name="targetPoint" type="Vector3">The position (must be in same space as current mesh) to look at</param> /// <param name="yawCor" type="Number">optional yaw (y-axis) correction in radians</param> /// <param name="pitchCor" type="Number">optional pitch (x-axis) correction in radians</param> /// <param name="rollCor" type="Number">optional roll (z-axis) correction in radians</param> /// <returns>Mesh oriented towards targetMesh</returns> var dv = AbstractMesh._lookAtVectorCache; var pos = space === Space.LOCAL ? this.position : this.getAbsolutePosition(); targetPoint.subtractToRef(pos, dv); var yaw = -Math.atan2(dv.z, dv.x) - Math.PI / 2; var len = Math.sqrt(dv.x * dv.x + dv.z * dv.z); var pitch = Math.atan2(dv.y, len); this.rotationQuaternion = this.rotationQuaternion || new Quaternion(); Quaternion.RotationYawPitchRollToRef(yaw + yawCor, pitch + pitchCor, rollCor, this.rotationQuaternion); } So, i would make my own lookAt function and add the clamp function just before the QuaternionRotaion.