Difference between revisions of "Knowledgebase:Moray"

From POV-Wiki
Jump to navigation Jump to search
m (Protected "Knowledgebase:Moray" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
m (Unprotected "Knowledgebase:Moray")
(No difference)

Revision as of 18:08, 5 September 2009

Topic 1

How can I set Moray to use the same handedness as POV-Ray? or: How can I set POV-Ray to use the same handedness as Moray?

The answer to the first question is: You can't.

But you can change the handedness in POV-Ray. By default POV-Ray uses a left-handed system. You can change it to right-handed by adding the following keyword to the camera definition:

  right <-4/3,0,0>

Now you can use coordinates like in Moray, with x pointing to the right, y pointing inside the screen and z pointing up.

This keyword also controls the aspect ratio of the image.

End of Topic: Go Back to the Table of Contents

Topic 2

When I use an object created with Moray directly in POV-Ray, the object is mirrored. What can I do?

This is a direct consequence of the right-handedness of Moray and left-handedness of POV-Ray. You can convert Moray-generated objects to POV-Ray default handedness with these transformations:

object
{ MorayObject
  scale <1,1,-1>
  rotate x*90
}

End of Topic: Go Back to the Table of Contents

Topic 3

How can I import my POV-Ray scenes into Moray so I can work on them in there?

The general answer is: I'm sorry but you can't.

There is a utility called pov2mdl which comes with Moray which converts POV-Ray 2.2 files to Moray mdl format, but it can't be used to convert files with new features of POV-Ray 3.x and newer.

End of Topic: Go Back to the Table of Contents

Topic 4

How do Moray UDOs work? Why don't they work for me?

(Answer by Johannes Hubert)

UDOs are User Defined Objects. A UDO file can contain several such objects, but for the sake of this answer let's assume that there is one object in the UDO.

Actually you will always have a pair of files: One UDO file and one INC file. Both are supplied by you (if you write them by hand) or some application that can export to Moray UDO format. They are not generated by Moray.

The UDO file contains a description of how the object should look in Moray. It is essentially a bunch of vertices and lines connecting them, telling Moray how to render the wireframe of the object. In Moray you can scale, rotate, translate and texture this object as you wish.

When exporting from Moray, the second file, the INC file, comes into play: It contains the description of the same object in POV-Ray scriptlanguage. It can contain everything POV-Ray understands. At the place in the scene where you used the UDO, Moray simply exports an include-statement for this INC file, and then applies all the transformations you did to the object.

A problem many beginners have with UDOs, is the filename of this INC file:

Let's say that you have a car-object, defined by a UDO (exported for example with sPatch). You call the object car, and when exporting you get the filepair car.udo and car.inc. You now want to look at your car and therefor create a simple Moray scene which you call car.mdl. This is where the trouble comes from: When exporting, Moray creates a file car.pov and a file car.inc (and probably some other files). Thus the car.inc from Moray overwrites the car.inc that was exported with the UDO.

The solution: Give your UDO a filename different fromt the MDL! For example: car_udo.udo, car_udo.inc and car.mdl.

End of Section: Go Back to the Table of Contents