Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,048
» Latest member: John Dannenberg
» Forum threads: 5,507
» Forum posts: 47,380

Full Statistics

Online Users
There are currently 639 online users.
» 1 Member(s) | 633 Guest(s)
Applebot, Baidu, Bing, Google, Yandex, Stephan den Ridder

Latest Threads
Request for 102735
Forum: Part Requests
Last Post: Stephan den Ridder
2 hours ago
» Replies: 3
» Views: 75
Wedgy-Slopes from '24 Spe...
Forum: Part Requests
Last Post: Ryan Hicks
7 hours ago
» Replies: 4
» Views: 55
WeDo 2.0 electronics
Forum: Part Requests
Last Post: Philippe Hurbain
Yesterday, 18:39
» Replies: 22
» Views: 35,474
Part request: 50986pb003 ...
Forum: Part Requests
Last Post: Gerald Lasser
2024-04-21, 16:16
» Replies: 4
» Views: 384
Technic 1982
Forum: Official Models
Last Post: Takeshi Takahashi
2024-04-21, 14:37
» Replies: 13
» Views: 2,990
LPub3D and highlight step
Forum: General LDraw.org Discussion
Last Post: Leszek
2024-04-21, 10:01
» Replies: 0
» Views: 70
Creator 2023
Forum: Official Models
Last Post: Marc Giraudet
2024-04-20, 21:42
» Replies: 5
» Views: 521
Lego House - Lego Exclusi...
Forum: Official Models
Last Post: Marc Giraudet
2024-04-20, 17:21
» Replies: 2
» Views: 253
The Muppets CMF - 71033
Forum: Parts Authoring
Last Post: Fredrik Hareide
2024-04-20, 10:08
» Replies: 12
» Views: 1,796
Technic 2019
Forum: Official Models
Last Post: Paweł Turalski
2024-04-19, 17:02
» Replies: 36
» Views: 29,322

 
  Rendering Help [Solved]
Posted by: Phil Ross - 2014-04-30, 0:00 - Forum: Rendering Techniques - No Replies

[Edit] I wasn't there was a better forum subsection for DIY rendering, and came across enough projects over there to realize that when I switched over to the show your work arrays, I got my matrices backward for the child transformations.


I've been working on my off again on again graphics engine project and decided to combine my passion for LEGO's as well, but I've hit a stumbling block with loading the .dat files. It seems the once I get a couple levels down everything goes to heck. i've been testing with 4070.dat (1x1 Brick with headlight), and everything seems fine except for the headlight (stud2a.dat) it's squashed on the y axis. Other problems pop up when I try other models. I know it's something in my matrix transformations, and I've tried everything I can think of (went from clean Matrix objects to "show your work" variable arrays, switched from floats to doubles, etc.), and hit a brick wall on searching for examples on the net, so I'm hoping another set of eyes will be what I need. I'm in the testing stage, so the code is kinda ugly, but for the double[12] arrays i'm holding the matrix in, 0->8 is "a" to "i" and 9->11 is "xyz". I'm also attaching a screen shot of 4070.dat with everything but "stud2a" and "stud" removed, so you can see how odd "stud2" looks. Thanks for any help.


Code:
void loadDAT(wchar_t * wcs_filename, bool b_child, double f33_matrix[12], bool b_bfcInvert)
{
    std::ifstream File(wcs_filename);
    std::string Line;
    std::string Name;
    std::string BFC;
    std::string BFCCommand;
    bool b_bfcInvertOut = b_bfcInvert;
    
    while(std::getline(File, Line))
    {
        if(Line == "" || Line[0] == '#')// Skip everything and continue with the next line
        continue;

        std::istringstream LineStream(Line);
        LineStream >> Name;
        LineStream >> BFC;
        LineStream >> BFCCommand;

        if(Name == "0")
        {
            if(BFC == "BFC")
                if(BFCCommand == "INVERTNEXT")
                    if(b_bfcInvertOut) b_bfcInvertOut = false;
                        else b_bfcInvertOut = true;
        }

        if(Name == "4")
        {
            double f_vertex[12];
            sscanf(Line.c_str(), "%*f %*f %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf", &f_vertex[0], &f_vertex[1], &f_vertex[2], &f_vertex[3], &f_vertex[4], &f_vertex[5], &f_vertex[6], &f_vertex[7], &f_vertex[8], &f_vertex[9], &f_vertex[10], &f_vertex[11]);
            Sv3_VERTEX v3_temp[4];
            for(int x=0; x < 4;x++)
            {
                v3_temp[x].pos.x = (f33_matrix[0]*f_vertex[(x*3)]) + (f33_matrix[1]*f_vertex[(x*3) + 1]) + (f33_matrix[2]*f_vertex[(x*3) + 2]) + f33_matrix[9];
                v3_temp[x].pos.y = (f33_matrix[3]*f_vertex[(x*3)]) + (f33_matrix[4]*f_vertex[(x*3) + 1]) + (f33_matrix[5]*f_vertex[(x*3) + 2]) + f33_matrix[10];
                v3_temp[x].pos.z = (f33_matrix[6]*f_vertex[(x*3)]) + (f33_matrix[7]*f_vertex[(x*3) + 1]) + (f33_matrix[8]*f_vertex[(x*3) + 2]) + f33_matrix[11];

                v3i_lego.v3ap_vertex.push_back(v3_temp[x]);
            }
        
            if(!b_bfcInvert) v3i_lego.uap_index.push_back(0 + i_triangleCount);
                else v3i_lego.uap_index.push_back(3 + i_triangleCount);
        
            v3i_lego.uap_index.push_back(1 + i_triangleCount);
            
            if(!b_bfcInvert) v3i_lego.uap_index.push_back(3 + i_triangleCount);
                else v3i_lego.uap_index.push_back(0 + i_triangleCount);

            if(!b_bfcInvert) v3i_lego.uap_index.push_back(2 + i_triangleCount);
                else v3i_lego.uap_index.push_back(1 + i_triangleCount);
            
            v3i_lego.uap_index.push_back(3 + i_triangleCount);
            
            if(!b_bfcInvert) v3i_lego.uap_index.push_back(1 + i_triangleCount);
                else v3i_lego.uap_index.push_back(2 + i_triangleCount);

            i_triangleCount += 4;
        }

        if(Name == "3")
        {
            double f_vertex[9];
            sscanf(Line.c_str(), "%*f %*f %lf %lf %lf %lf %lf %lf %lf %lf %lf", &f_vertex[0], &f_vertex[1], &f_vertex[2], &f_vertex[3], &f_vertex[4], &f_vertex[5], &f_vertex[6], &f_vertex[7], &f_vertex[8]);
            Sv3_VERTEX v3_temp[3];
            for(int x=0; x < 3;x++)
            {
                v3_temp[x].pos.x = (f33_matrix[0]*f_vertex[(x*3)]) + (f33_matrix[1]*f_vertex[(x*3) + 1]) + (f33_matrix[2]*f_vertex[(x*3) + 2]) + f33_matrix[9];
                v3_temp[x].pos.y = (f33_matrix[3]*f_vertex[(x*3)]) + (f33_matrix[4]*f_vertex[(x*3) + 1]) + (f33_matrix[5]*f_vertex[(x*3) + 2]) + f33_matrix[10];
                v3_temp[x].pos.z = (f33_matrix[6]*f_vertex[(x*3)]) + (f33_matrix[7]*f_vertex[(x*3) + 1]) + (f33_matrix[8]*f_vertex[(x*3) + 2]) + f33_matrix[11];

                v3i_lego.v3ap_vertex.push_back(v3_temp[x]);
            }
        
            if(!b_bfcInvert) v3i_lego.uap_index.push_back(2 + i_triangleCount);
                else v3i_lego.uap_index.push_back(0 + i_triangleCount);
            
            v3i_lego.uap_index.push_back(1 + i_triangleCount);
    
            if(!b_bfcInvert) v3i_lego.uap_index.push_back(0 + i_triangleCount);
                else v3i_lego.uap_index.push_back(2 + i_triangleCount);

            i_triangleCount += 3;
        }

        if(Name == "1")
        {
            double f_vertex[12];
            wchar_t wcs_filenameSub[200];
            sscanf(Line.c_str(), "%*f %*f %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %S", &f_vertex[9], &f_vertex[10], &f_vertex[11], &f_vertex[0], &f_vertex[1], &f_vertex[2], &f_vertex[3], &f_vertex[4], &f_vertex[5], &f_vertex[6], &f_vertex[7], &f_vertex[8], wcs_filenameSub);
            double f33_out[12] = {f_vertex[0],f_vertex[1],f_vertex[2],f_vertex[3],f_vertex[4],f_vertex[5],f_vertex[6],f_vertex[7],f_vertex[8],f_vertex[9],f_vertex[10],f_vertex[11]};

                double f33_hold[12] = {1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f};
            
                f33_hold[0] = (f33_out[0] * f33_matrix[0]) + (f33_out[1] * f33_matrix[3]) + (f33_out[2] * f33_matrix[6]);
                f33_hold[3] = (f33_out[3] * f33_matrix[0]) + (f33_out[4] * f33_matrix[3]) + (f33_out[5] * f33_matrix[6]);
                f33_hold[6] = (f33_out[6] * f33_matrix[0]) + (f33_out[7] * f33_matrix[3]) + (f33_out[8] * f33_matrix[6]);
            
                f33_hold[1] = (f33_out[0] * f33_matrix[1]) + (f33_out[1] * f33_matrix[4]) + (f33_out[2] * f33_matrix[7]);
                f33_hold[4] = (f33_out[3] * f33_matrix[1]) + (f33_out[4] * f33_matrix[4]) + (f33_out[5] * f33_matrix[7]);
                f33_hold[7] = (f33_out[6] * f33_matrix[1]) + (f33_out[7] * f33_matrix[4]) + (f33_out[8] * f33_matrix[7]);
            
                f33_hold[2] = (f33_out[0] * f33_matrix[2]) + (f33_out[1] * f33_matrix[5]) + (f33_out[2] * f33_matrix[8]);
                f33_hold[5] = (f33_out[3] * f33_matrix[2]) + (f33_out[4] * f33_matrix[5]) + (f33_out[5] * f33_matrix[8]);
                f33_hold[8] = (f33_out[6] * f33_matrix[2]) + (f33_out[7] * f33_matrix[5]) + (f33_out[8] * f33_matrix[8]);
                
                f33_hold[9] = f33_hold[0]*f_vertex[9] + f33_hold[1]*f_vertex[10] + f33_hold[2]*f_vertex[11] + f33_matrix[9];
                f33_hold[10] = f33_hold[3]*f_vertex[9] + f33_hold[4]*f_vertex[10] + f33_hold[5]*f_vertex[11] + f33_matrix[10];
                f33_hold[11] = f33_hold[6]*f_vertex[9] + f33_hold[7]*f_vertex[10] + f33_hold[8]*f_vertex[11] + f33_matrix[11];
            
            loadDAT(CfileLocations::getModelsSubParts(wcs_filenameSub),true,f33_hold, b_bfcInvertOut);
        }

    }
}



Attached Files Thumbnail(s)
   
Print this item

  Fast Photoreal Rendering +++ UPDATE +++
Posted by: Michael Klein - 2014-04-29, 2:31 - Forum: Rendering Techniques - Replies (28)

Hi,

I am a pioneer in 3d animation and LEGO is the mother of all 3d. When I found LDRAW a long time ago on the internet I started to do some research with digital LEGO a long time before the LEGO movie. Due to my limited time as a company owner I just made some tests and that's it. Now I am testing with MODO and could unlock a new level of detail and realism which is worth to share. LDD2POVRAY is a nice toy but not really useable for more complex stuff like handling bigger scenes with animation, simulation, effects etc. And it's far too slow. The actual result looks quite promising. I need to find a way to get the LEGO logo on the studs. Unfortunately the replacements for stud.dat and stud2.dat are broken and give not the geometry shown in the pictures: http://www.ldraw.org/cgi-bin/ptdetail.cg...-logo3.dat

The fun part is now that I can import everything coming from LeoCAD or MLCad and setup the materials and shading in 15+ minutes to get this quality. A rendering of this Snowspeeder in HD will take around 4-5 minutes on my 12 core DELL. I wished LEGO would allow an export from LDD. I will update this thread with more results. Have fun.

[Image: 7130_Snowspeeder_002.jpg]

[Image: 7130_Snowspeeder_003.jpg]

[Image: 7130_Snowspeeder_004.jpg]

//

UPDATE +++ Studs with LEGO logo

[Image: 7130_Snowspeeder_v05b_Camera_04.jpg]

And here's a result where you see the missing panel in the cockpit now. The panel picture is modeled with MLCad I think and not based on a .dat model. Therefore the python script couldn't convert it. But in MLCad you can export in primitives and then you get the complete model but no separate bricks anymore. And this causes again problems with the rounding shader, low-res studs only as you can see and that's not the model I want to have. So I need to do more investigation and talk to the dev team of that LDR importer to fix this for the future.

[Image: 7130_Snowspeeder_Complete_v03_Camera_05.jpg]

4K Rendering with materials from the Peeron Color List. I made intense tests with hi-res studs and bevels I created with Primitiv Generator 2 but the results are the same when I start to adjust the LEGO logo and edges with the rounded edge feature. And the geometry will be much higher. The Peeron RGB colors are looking good. You need to click again on the picture to scale it to full 4K.

[Image: 7130_Snowspeeder_Normal_Studs_v03c_LEGO_RGB_Wide_4K.jpg]

And another test with a Technic model. I fixed some missing parts but still some bended hose is missing.

[Image: 8070_Technic_Car_v07c_4K.jpg]

The ultimate renderstresstest with over 5.000 bricks what will take full 32 GB of RAM and patience. Check out the 8K version with impressive details:

[Image: 10179_Millennium_Falcon_UCS_v03_Front_8K.jpg]

[Image: 10179_Millennium_Falcon_UCS_v03_Back_8K.jpg]

Another test with the great 10019 set. I wished it were based on the original LEGO CAD data from Billund incl. labels *:-)

[Image: 10019_Rebel_Blockade_Runner_v01_Front_8K.jpg]

[Image: 10019_Rebel_Blockade_Runner_v01_Back_8K.jpg]

Print this item

  Getting Started—Mac
Posted by: Melissa Hunt - 2014-04-27, 21:58 - Forum: Help - Replies (2)

Hi! I'm new to LDraw and trying to get it set-up on my iMac. I've downloaded the complete library, but receive an error page when I click on the link to download software in Step 5.

What shall I do next?

Print this item

  MLCAD 50 EURO Reward for adding parts !
Posted by: Marcel Brinks - 2014-04-15, 10:36 - Forum: Part Requests - Replies (27)

i reward 50 Euro for the one that can add the following parts to MLCAD

Trans-Clear Door 1 x 4 x 6 with Stud Handle 60616 (Multi Colours possible)
Dark Bluish Gray Tile 2 x 2 with Computer Monitor Pattern 1, with White Power Magnus Forsberg
Switch Icon 3068bpb058 the 4 difrent computer monitors similar as well..
Reddish Brown Container, Bucket 1 x 1 x 1 95343 (Multi Colours possible) Magnus Forsberg
Dark Tan Container, Bucket 1 x 1 x 1 Handle 95344 (Multi Colours possible) Magnus Forsberg
how ever the container not show in MLCad ?

next
92589 Bar 1 x 4 x 6 with End Protrusions

added
Windscreen 2 x 6 x 2 Train with Glass 6567 (Multi Colours possible)

i keep waiting till these items are added and after 2 years i think i have to
set a price on this and beg someone to add this

i have lego i design models till now i have kept a low profile dont feel a shamed to claim your reward you can order for 50 euro on lego parts or a model or recieve 50 euro Magnus Forsberg

donating to this website i will do as well but that have nothing to do with getting the parts done Tongue

thanks in advance
Marcel

Print this item

  973pr2538c01 Emmet's torso from the Lego Movie
Posted by: Earnest J. Banbury - 2014-04-14, 8:35 - Forum: Parts Authoring - Replies (18)

I've written my own simple LDraw exporter for Blender (Link). And as a way of testing it, I modeled the construction worker torso from the Lego Movie.
Maybe someone is interested in it. Feel free to use it as you see fit.

[Image: 973pr2538c01.jpg]



Attached Files
.dat   973pr2538c01.dat (Size: 21.99 KB / Downloads: 1)
Print this item

  part request
Posted by: Matt `da Wolf - 2014-04-14, 1:48 - Forum: Part Requests - Replies (6)

3039pb54



Attached Files
.jpg   2924-src.jpg (Size: 85.57 KB / Downloads: 25)
Print this item

  James' website?
Posted by: Philippe Hurbain - 2014-04-08, 11:37 - Forum: Website Suggestions/Requests/Discussion - Replies (1)

I just noticed that James website as linked here (http://silo.riv.csu.edu.au/~jjessiman/lego/index.html) returns a 403 error. Fortunately it's still possible to recover things through the internet archive...

Print this item

  Bricksmith 3.0: Oh so Flexible!
Posted by: Allen Smith - 2014-04-08, 6:20 - Forum: LDraw Editors and Viewers - Replies (5)

[Image: icon32.png]

Bricksmith 3.0 adds the following features:

  • LSynth integration with real-time, drag-and-drop constraint editing for creating flexible hoses, chains, bands, etc.
  • Curved parts are drawn with smooth shading
  • Can change spin center to center of selection
  • “Walk-Through” camera mode lets you view your model from the inside.
  • Search feature to select all parts of a particular color or name
  • Translucent parts correctly show the model behind them. (The interiors of translucent parts may not be rendered correctly.)
  • Performance improvements for rendering models with large numbers of parts.
  • “Insert Related” command automatically inserts selected parts that match the selection, e.g. drawers for a cupboard, tires for a wheel, window glass for a window frame.
  • Split Step command

It also fixes the following bugs:
  • Fixed modifier shortcuts for mouse tools not working after invoking a contextual menu on 10.8+

Bricksmith 3.0 has some of the most exciting features yet. And I would like to extend a very special thanks to Robin Macharg and Ben Supnik for implementing most of them.

The integrated LSynth editor in Bricksmith 3.0 strips away all the pain of working with flexible elements. You get instantaneous feedback while editing your constraints. There's nothing to download or set up. No meta-commands to edit. No external program to run. No separate files for constraints and synthesized output. The only thing between you and your hose is your mouse.

LSynth in Bricksmith works like this:
  • Bricksmith comes pre-packaged with the LSynth command-line tool, the configuration files, and the unofficial parts.
  • When you add or edit an LSynth element and constraints, Bricksmith automatically calls LSynth with just the element you are working on, parses the synthesized result, and inserts it into your model
  • The original constraints are preserved in such a way that they are still editable. Every time you make a change, Bricksmith automatically deletes the stale synthesis and inserts a new one.
  • When you deselect an LSynth element in Bricksmith, the constraints vanish, and all you see is the synthesized hose.
  • If you select the hose again, it becomes translucent and the constraints are revealed again, ready for you to edit them.
  • If you open a file with just constraints, Bricksmith automatically generates the synthesized output for you. But it's completely non-destructive; the constraints are always preserved for you to edit them later.

Bricksmith's LSynth integration was developed by Robin Macharg, and I greatly appreciate the contribution!

But don't overlook the other great features added in the release. Ben Supnik has done some fantastic rendering work for smoothed shading and transparency sorting. He's also added a feature called "Insert Related", which is supposed to make it easier to find and position parts that always go together, such as wheels and tires, or windows and glass. The data for this features comes from a simple MPD file which contains groupings of related parts. There's a meta-command to identify groups and their names; everything else is inferred. It's really easy to add to this file, and I hope people do.

Bricksmith requires Mac OS X 10.6 or later(*), and may be download it at <http://bricksmith.sourceforge.net/>.

Sincerely,
Allen Smith

(*)only tested on 10.9

Print this item

  LEGO® The Hobbit™ Demo (PC)
Posted by: Rolf Osterthun - 2014-04-07, 17:15 - Forum: Off-Topic - No Replies

Hey,

a demo of the new game "LEGO® The Hobbit™" is available for PC. You can download it from http://videogames.lego.com/en-us/lego-th...o-download.

Rolf

Print this item

  LDCad 1.3a (win+linux)
Posted by: Roland Melkert - 2014-04-06, 18:50 - Forum: LDraw Editors and Viewers - Replies (25)

I just completed and uploaded LDCad 1.3a.

It's mostly a maintenance update changes include:

  • Minor bugfixes
  • Part bin tweaks (added technic motor and mindstorms groups)
  • New part snapping info for panels, motors and mindstorms
  • Templates for eletric cables

I also made a short tutorial video to illustrate how to create/work with submodels (mpd's).

[Image: 1-3a-ForumScrShot.png]

As always you can download it at: melkert.net/LDCad

This will probably be the last 1.3 version, so unless a very severe problem pops up I'll be working on 1.4 from now on.

It's main feature will be scripted animation, here's a small teaser Smile

[edit] forgot the site link

Print this item