realbasic-games
[Top] [All Lists]

Realtime editing of a trimesh from an object3D

To: realbasic-games at lists dot realsoftware dot com
Subject: Realtime editing of a trimesh from an object3D
From: Martin Dillon <martin dot dillon at optusnet dot com dot au>
Date: Tue, 27 Sep 2005 23:00:34 +1000
Delivered-to: realbasic-games at lists dot realsoftware dot com
I'm trying to move individual vertices within a trimesh that has been extracted from an object3D using the new RB2005r3 features. I can extract the trimesh ok, and change the position of individual vertices, but I can't re-assign my changes back to the object3D to show the new shape in RB3Dspace.

 dim tm as trimesh
 dim Object1 as Object3D

 // load and display a pre-existing model
 Object1 = New Object3D
 f = GetFolderItem("TwoBoxes.3DMF")
 Object1.AddShapeFromFile(f)
 Object1.scale = 0.2
 Object1.RenderBackFaces = True
 RB3Dspace1.objects.Append Object1

 //get the first trimesh in the model
 tm = new trimesh
 tm = Object1.Trimesh(0)

  //get the xyz coordinates of the first vertex in the trimesh
  x1 = tm.VertexPositions.X(0)
  y1 = tm.VertexPositions.Y(0)
  z1 = tm.VertexPositions.Z(0)

  //change the xyz position of the first vertex to warp the model
  tm.VertexPositions.SetXYZ(0, x1 + 10 , y1+10, z1 +10)

// Re-assign the trimesh back to the Object3D so that it's new shape is displayed Object1.Trimesh(0) = tm // <-- This assignment is illegal and won't compile. Everything works until the last line. What is the correct way to achieve this?

Thanks,
Martin
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>