[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Delphi GLScene export scene

Posted on 2013-01-25
7
Medium Priority
?
1,416 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 28

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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 give a brief orientation and organization of Logic Pro X, and how to access different work spaces quickly with keyboard shortcuts.
Viewers will learn how to create burn videos onto a DVD using Nero Suite including creating a DVD menu and chapters.
Suggested Courses

649 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