Scene File Documentation-beginner queries

General discussion regarding exporter development in general.

Moderators: Ratow, coordinators

Scene File Documentation-beginner queries

Postby Sheltem » Sun Jan 04, 2009 7:00 am

Hi Guys,

I am in the VERY early stages of writing an exporter for REVIT using vb.net and the revit API. This is more a hobby and will probably take a while since I only have a couple of hours a week / month to spend on it but anyway I am happy to give it a shot!

I looked at the scene file documentaion and got some questions, apologies in advance If I missed the obvious...

LookAt - I couldnt find much (any?) documentation on this parameter. The sample files shows three pairs of coordinates (vectors?) for this. Am I right assuming that the first is the camera position, second view direction and third ? (camera rotation around x or y axis?)

Sampler:
metropolis::largemutationprob - default value is 0.4f - what does the f stands for?
metropolis::micromutationprob - default is 0.f - what does the f stands for?

Filter:
The common filter parameters are xwidth and ywidth. Box and sinc filter have xwidth and ywidth listed as specific parameters.
Does this mean that those two filters
- have default values for xwidth and ywidth that differ from then ones for the common filter or
- have two sets of xwidth and ywidth parameter?

Thanks in advance for the help.

S
Sheltem
 
Posts: 122
Joined: Sun Jun 15, 2008 11:06 am

Re: Scene File Documentation-beginner queries

Postby lempour » Sun Jan 04, 2009 8:07 am

Hi, welcome.
I hope I'm not wrong here, I'll try to explain afaic:
- LookAt is camera vectore definition (see core/context.cpp for more details)
- f means float, as luxrender is written in C++ it inherites the typing conventions
- in case of box and sinc filter these default values are different as well as their matematical meaning

regards,
lem
lempour
 
Posts: 190
Joined: Mon Oct 29, 2007 9:12 am

Re: Scene File Documentation-beginner queries

Postby Sheltem » Sun Jan 04, 2009 6:18 pm

Hi lem,

thanks for the answers. I just want to clarify: :oops:

Sampler:
metropolis::largemutationprob - default value is 0.4f - so the actual default value is 0.4 ?
metropolis::micromutationprob - default is 0.f - so the actual default value is 0.0 ?

Filter:

I planned to have a commonn filter class which the specific filter classes inherit: This common class has two properties (xwidth and ywidth)
If I understand you right all I have to do for the box and sinc filter is to change the default values of xwidth and ywidth once the respective specific class gets instanciated?

LookAt: hmmmm core / context.cpp are C++ class modules? I've got no idea how to download them via the cvs + I don't "speak" C++.
I might give blender a go and see how these values change when I move the camera around...

Cheers!

S
Sheltem
 
Posts: 122
Joined: Sun Jun 15, 2008 11:06 am

Re: Scene File Documentation-beginner queries

Postby Radiance » Sun Jan 04, 2009 8:42 pm

Hi,

The Lookat transformation takes 3 vectors as options:

LookAt 0 0 0 0 1 0 0 0 1

The first vector (0 0 0 in my example) is the position of the camera.
The second vector (0 1 0) is the position of the target of the camera.
The last vector (0 0 1) is the up vector.

This is quite a simple transformation, which allows you to specify 2 points,
one where the camera is located and another point of 'interest'.
This can also be given as a unit vector.

The up vector is a unit vector which defines how the camera is help up,
it should point upwards of your camera, eg if it is held straight, it will be 0 0 1 (+Z up)

If you make a fist with your right hand,
and stick out your main finger and thumb (upwards), and point it to someone (like a gun),
you have the same system. your main finger is the target vector and your thumb pointing up is the up vector.

You can also use any other of lux's transforms instead of a LookAt instead,
which you can see in the docs...

Radiance
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: Scene File Documentation-beginner queries

Postby Sheltem » Sun Jan 04, 2009 9:51 pm

Hi Radiance,

that clarifies that :D . Thanks.

So far I managed to get the camera location + view direction in Revit...I guess the real work starts now trying to export any geometry. :roll:

I will post again once I managed to export something to lux... ;) or stumbled across something else... :oops:

S
Sheltem
 
Posts: 122
Joined: Sun Jun 15, 2008 11:06 am

Re: Scene File Documentation-beginner queries

Postby Gungho3D » Mon Jan 05, 2009 7:12 pm

Welcome fellow hobby coder!

Another means of getting an extremely good handle on how things hang together is to:
1. Download & install the Open Source 3D product Blender 3D (http://www.blender.org/)
2. Download & install 'LuxBlend' (http://www.luxrender.net/wiki/index.php/Download)
3. Start pulling apart what comes out of the LuxBlend exporter.

This has been invaluable for making (slow) progress in getting a Lightwave 3D exporter happening.

Cheers,
Gung
Gungho3D
 
Posts: 17
Joined: Fri Sep 05, 2008 3:31 am

Re: Scene File Documentation-beginner queries

Postby Sheltem » Mon Jan 05, 2009 9:04 pm

Hi Gung,

yeah, looks like the way forward :) So far I managed to get some of the bones of the exporter interface into Revit. I am closely following the luxblend exporter there ;)

Getting a bid ahead of myself here but just wondering: for your exporter do you store any lux specific information in regards to material or camera settings in the actual lightwave file or do you separate them into another file? Revit seems to be a bit of a mixed bag. Currently it can store additional information in form of 'shared parameters' which will need to be associated with an object. What worries me is the big fat note on the first page of the api docs saying that the api is very likley to change in future and I wonder whether this includes the handling of shared parameters. One way around that would be storing any lux specific data in an xml file and use the unique object id to link them back to the object in revit...


Cheers!

S
Sheltem
 
Posts: 122
Joined: Sun Jun 15, 2008 11:06 am

Re: Scene File Documentation-beginner queries

Postby Radiance » Mon Jan 05, 2009 10:25 pm

The blender exporter (luxblend) has a custom code system that stores everything as 'attributes' on objects and materials. (attributes are packed strings which contain lux integer, float and string/choice values)

Radiance
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: Scene File Documentation-beginner queries

Postby Sheltem » Tue Jan 06, 2009 12:20 am

Thanks Radiance,

I will keep that in mind. Once I get to this point I will see how I can store the lux data within the actual revit file.

S
Sheltem
 
Posts: 122
Joined: Sun Jun 15, 2008 11:06 am

Re: Scene File Documentation-beginner queries

Postby Sheltem » Sun Jan 25, 2009 4:55 pm

Hi Guys,

I am slowly but surely making progress... I managed to export a simple mass object to Lux. :D

So far I have set up the classes for some of the plugins (film,camera, pixel filter...) + some basic hooks into the Exporter GUI.
Nothing done in regards to materials yet...

Some more questions:
The docs indicate that scene files can be broken up into multiple files:
- can I have more than 1 geometry (.lxo) file?
- how to you determine the zoomfactor on a perspective camera? Is this done via the FOV, the smaller the angle the bigger the zoom?

Cheers,

S
Attachments
early - Alpha .png
Sheltem
 
Posts: 122
Joined: Sun Jun 15, 2008 11:06 am

Next

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests