≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
How to Linepick Clones and animated Meshes??
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b]csp-games[/b] wrote: Not so much progress, but one thing I want to mention: So I'm using Example 3 of the CL tutorials, the collision example that allows one to "shoot cubes at a wall". Ok, there's the Linepick code that works with the loaded mesh node, and not with the clones. But it gives only the 3D coordinate of the ray impact, not the node ID of the node that was hit. The original line was: [code] var collisionPoint = scene.getCollisionGeometry().getCollisionPointWithLine(startLine, endLine, true, null); [/code] "Null" allows to provide a triangle structure to receive the vertex coords of the triangle that was hit by the line, so I say: [code] var mytriangle=new CL3D.Triangle3d(true); // note its 3d, not 3D ! unlike in Vertex3D( var collisionPoint = scene.getCollisionGeometry().getCollisionPointWithLine(startLine, endLine, false, mytriangle,false); if (collisionPoint) { //alert(scene.getCollisionGeometry().getRelatedSceneNode()); alert(mytriangle.pointA); ... [/code] mytriangle should consist of 3 vect3D structures named pointA, pointB and pointC, so I could say: x=mytriangle.PointB.X; Now the thing is, this works perfectly for pointB and C, but pointA will return not a Vect3D, but just a boolean "true" - that's weird, a bug? Because, at least this triangle structure would have allowed me to simply go trough some stored mesh buffer data and compare triangles, and given there is only 1 triangle at that very position, I could at least identify the involved mesh (yet, still not working on clones, however). But as pointA doesn't seem to work, I can't see how to use this.[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact