?
Solved

Delphi GLScene export scene

Posted on 2013-01-25
7
Medium Priority
?
1,348 Views
Last Modified: 2013-12-04
i have a glscene project. In the sceneviewer i import some stl files as freeform. The user can interact with this objects (move and rotate them with mouse). Now i have to export this whole scene to one stl file, so the position and the rotation of the freeforms should be like in the scene after this export ("merge"). I found this thread  here about a similar problem, i tried this, but this creates an broken stl file (tried open with meshlab).

I hope there is some idea for creating a solution. If somebody knows a solution for another 3d-file format, it will be great too.

Kind Regard
0
Comment
Question by:Kuschelino
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 38824657
I suggest great 3ds-import-library. It is not importer only, but can export to 3ds too. If you can make little demo project with export to stl, we can look into problem more easily. Stl stands as quite simple acsii format (STL file format) and export to it must be simple task too.
0
 

Author Comment

by:Kuschelino
ID: 38827274
I have a small demo project, really small. You can move to stl objects with cursor keys.
Before you can move the object, you have to select one with the mouse.

Hope this helps for finding a solution.
Delphi 2010 Project with 2 stl files attached.
!!!!! Attention:
I have to remane the included stl files in 1.bmp (should be 1.stl) and 2.bmp (should    be   2.stl)
 the binary is renamed to project1.bmp (should be project1.exe)
--> becaus upload restrictions.


Kind Regards

I will be eternally grateful, expert exchange is my last hope.
3ddemo.zip
0
 

Accepted Solution

by:
Kuschelino earned 0 total points
ID: 38836546
I have found the solution by my self. The trick for the binary stl format was, that i have the heade caluculated right.
var j : integer;
   i : Integer;
   header : TSTLHeader;
   dataFace : TSTLFace;
   list : TAffineVectorList;
   var f: Textfile;

const
   cHeaderTag = 'GLScene STL export';
begin

FillChar(header.dummy[0], SizeOf(header.dummy), 0);
Move(cHeaderTag, header.dummy[0], Length(cHeaderTag));
//calculate header count
 for j := 0 to objects.Count - 1 do
 begin
      list:=TGLFREeform(objects[j]).MeshObjects.ExtractTriangles;
      header.nbFaces:= header.nbFaces + list.Count div 3;
 end;

       aStream.Write(header, SizeOf(header));

 for j := 0 to objects.Count - 1 do
 begin
      list:=TGLFREeform(objects[j]).MeshObjects.ExtractTriangles;


   try

      i:=0; while i<list.Count do begin
         dataFace.normal:=CalcPlaneNormal(list[i], list[i+1], list[i+2]);

        dataFace.v1:=VectorTransform(list[i],TGLFREeform(objects[j]).AbsoluteMatrix);
        dataFace.v2:=VectorTransform(list[i+1],TGLFREeform(objects[j]).AbsoluteMatrix);
        dataFace.v3:=VectorTransform(list[i+2],TGLFREeform(objects[j]).AbsoluteMatrix);

         aStream.Write(dataFace, SizeOf(dataFace));
         Inc(i, 3);

      end;

   finally
      list.Free;
   end;

 end;

Open in new window

0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 39479169
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
I have a Synology DS212+ NAS.  These are not only great for backup and normal NAS stuff, but also for delivering media throughout your home or LAN via DLNA.  I copied my whole audio collection from iTunes over to the box, but couldn't figure out how…
This video will demonstrate how to customize windows, tools, and control bars, and save them as screen sets. Open and resize windows: Customize the toolbar: Customize the control bar: Customize your tool selections: Your screen set is alread…
Viewers will learn how to use Macros for greater control over Rack parameters in Ableton Live. Group devices into a Rack by selecting them and pressing Command-G (Ctrl-G on PC): Control-click (Right Click on PC) a parameter to access pop-up menu, …
Suggested Courses
Course of the Month8 days, 18 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question