Vertex coordinates
Blitz3D Forums/Blitz3D Programming/Vertex coordinates
| ||
Hi, I think I've done this before or asked or something but.. I want to rotate and position a mesh using blitz Entity commands not the Mesh commands.. Like RotateEntity cube,10,0,0 The problem I'm having is when using such a command I can't retrieve the updated position/scale/angle of the vertex's in the mesh, they remain as they were when the mesh was loaded (as they should)... Using RotateMesh cube,10,0,0 corrects this but with my particular needs I need to use the Entity commands.. Do I recall a way to grab the actual updated vertex information via Tform command after a PositionEntity, ScaleEntity or RotateEntity is preformed??? Any help is much appericated... thanks |
| ||
I lose the real-coordinates of the vertex's in the mesh.. I'm not sure what you mean by this because using the Rotate/Scale/PositionEntity commands doesn't actually alter the original mesh, so the original mesh data should remain unaffected. |
| ||
Re-phrased it... |
| ||
TFormPoint VertexX(Surface,Index), VertexY(Surface,Index), VertexZ(Surface,Index), YourMesh, 0 ;; Sets the TFormedX/Y/Z() instructions to return the global position of a vertex, if I recall correctly Try something like that. Edit: Actually, I'm not sure if this also includes operations done with ScaleEntity... |
| ||
shame my hosting isn't up because my single surface stuff has an entity lib that does just this. Perhaps someone can send it to you? |
| ||
Thanks Noel. Rob - thanks as well - I'm pretty sure I have your lib here somewhere... /me off to search... |
| ||
It'll be easy enough to take scale into account,tFormPoint verteX(srf,vert)*entityXScale,vertexY(srf,vert)*entityYScale,vertexZ(srf,vert)*EntityZScale,entity,0 newX=tformedX():newY=tformedY():newZ=tformedZ() EntityXYZscale being local floats or consts being the same values you pass to entityScale...unless blitz uses a less standard way of scaling..Dunno.. |
| ||
ACtually, I think the tform point command accounts for scaling. not sure though. |
| ||
Yah looks like scale is accounted for... All these methods work great if the object remains static.. What if i altered a meshes bone like so: abone=FindChild(MyEntity,"Pivot_1") RotateEntity abone,10,0,0 Now the Tform don't return the vert's new positions.. I'm pretty sure thats Blitz optimization at work? Is there any way at all to retrieve the newly formed information from the Verts attached to this bone?? The reason I ask is, the project i'm currently working on - I want to alter a mesh by bone structure then export it back out in the current screens positions... Without being able to snag the new vertx,y,z's it seems imposible. Thanks.. |
| ||
You can't retrieve the true positions of the vertexs that are affected by bones in .b3d, unfortunetly :( |
| ||
bah, figured out a way to do it! |