[REQ] Primitives

Feature requests, bug reports and related discussion
User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

[REQ] Primitives

Post by CTZn » Thu Feb 08, 2007 1:29 pm

Seconding kram's request, I'm creating this topic to ask about primitives. They are usefull because they are perfect in shape, and even more now that they can be used as "cuts" for medias if they are filled with "air".

So these might be usefull:

_____
a box

Need: 1 parameter: width for a cube.

optional:

- <width1> and <width2> to define a box, in the XYZ order
- <pivot> tag to set the pivot of the shape to be either top or bottom.

Without that optional tag, the default would be that the pivot is at the center of mass of the cube. The aim is to have a cube resting straight away on the floor.

________
a cylinder

Need: 2 parameters: radius and height.

optional:

<radius2>, wich would be the inner radius for a tube (hollowed cylinder)

_____
a cone

Need: 2 parameters: radius and height

optional:

a <center> or <pivot> tag if the default is not at the center of the circle.
maybe a <radius2> to create a truncated cone.


A pyramid ?

From my experience, the box and tube/cylinder are the most usefull. As usual, I'm giving detailed requests, not to claim the ownership of any idea, but to give a layout that may be "artist friendly". Just my few cents.

Cheers

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Thu Feb 08, 2007 10:18 pm

That's great! Thanks!

Just for checking:
Can you also post a complete example?

Even a hollowed cylinder is there?
Very good.
a box

Need: 1 parameter: width for a cube.

optional:

- <width1> and <width2> to define a box, in the XYZ order

-> do you mean a qaudratic prism?
Then there should be <with3>, so you can get a cuboid.

General: How to rotate those primitives?
A sphere doesn't have a rotation, but the rest....

If there are so much parameters like <with1;2;3>,
can you create an ellipsoid with <radius1;2>?

Then, if you have more than 1 size parameters, how the axes are numbered?
1=x 2=y 2=z?

Deus
Posts: 336
Joined: Sun Feb 04, 2007 3:47 am

Post by Deus » Thu Feb 08, 2007 11:08 pm

Yeah CTZn you should really take credit for inventing the cube. Not only as a primitive in a raytracer but as a general concept. You can get royalty for every Gamecube, sugar cube and six sided dice ever produced. think about it! ;-)

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Thu Feb 08, 2007 11:19 pm

@Deus: I just don't get, what you mean...

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Fri Feb 09, 2007 12:30 am

I did get you Deus... He is joking, Kram, telling I invented the cube :D

Today I'm in a good mood, so take that great concept for free, before I change my mind Deus ;) I gave that precision in my first post because I wanted to be clear. Maybe if I give detailed ideas and they are just implemented, one could fear I will claim the ownership of these ideas (would they be trivial). That was just a written confirmation I never will, even if (imagine) I create a logo for Indigo and it is choosen (again that's metaphorical example) I will never ask for any special right as long as Indigo is given to us for free. Maybe that sounds presomptuous but I just wanted to make that clear. I don't want requests to be disregarded because my intentions would be unclear, that's it :)

Kram, I'm posting this as a request, sorry, these are just ideas, not actual features of Indigo :? hopefully we will get that one day ! That's what this forum is for.

I give the request a low priority afaic.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Fri Feb 09, 2007 1:19 am

A pyramid would have a tag
"<sides>"
which would define the number of sides, the rest would be similar to cone...

User avatar
zsouthboy
Posts: 1395
Joined: Fri Oct 13, 2006 5:12 am

Post by zsouthboy » Fri Feb 09, 2007 6:52 am

This isn't very useful of an idea.

A sphere is the most logical, and it's already in.

No need to complicate the scene loading code with additional primitives, IMO of course.

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Fri Feb 09, 2007 2:12 pm

Again, the use IMO is the perfection of the shape, and the fact it requires no geometry data. But your opinion is acknowledged zsouthboy ;)

Say it's a suggestion more than a request, maybe for when Indigo will be "fully" develloped, or when Ono wants to have a rest with some easy code. This isn't required :)

BTW I'll have more suggestions next days (I won't use the [REQ] tag for them, sorry this one was abusive), so don't be surprised. I've been thinking at some stuff, why not share that ?

For me, ideas are free, only applications can be owned (and sometimes that's a bad idea).

Cheers !

User avatar
zsouthboy
Posts: 1395
Joined: Fri Oct 13, 2006 5:12 am

Post by zsouthboy » Sat Feb 10, 2007 2:11 am

It didn't occur to me that the geometry data (and, by direct cause, the size of the xml file) would be reduced.

Anyway, I didn't mean to shit on your ideas :)

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Sat Feb 10, 2007 2:20 am

Anyway, I didn't mean to shit on your ideas :)
Wow, this idea far from me !!! As long as you let me defend my idea, there is no problem with me zsouthboy !

Cheers man !

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sat Feb 10, 2007 2:50 am

Maybe, cubes aren't necessary, since they only use 6 vertices and have a perfect shape.
But everything, which is perfectly round somewhere, would be helpful:
Round things need loads of geometry to be imperfectly round. Primitives wouldn't use any geometry data but would be shaped perfectly round.
So the main request should concentrate to
*cylinder
*cone
*tube
*ellipsoid

Another idea, I have, but would be much harder to do, I think:
Perfect UVs for Primitives (especially spheres and ellipsoids):
They would be UVmapped as perfect as possible with the resolution of the texture images. As if every pixel is translated to one vertex.
Last edited by Kram1032 on Mon Feb 26, 2007 7:48 am, edited 1 time in total.

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Sat Feb 10, 2007 3:23 am

Maybe, cubes aren't necessary, since they only use 6 vertices and have a perfect shape.
But everything, which is perfectly round somewhere, would be helpfull
That's correct ;)

User avatar
Silverman
Posts: 65
Joined: Sat Nov 25, 2006 11:05 am
Location: Chico, CA USA
Contact:

Post by Silverman » Sat Feb 10, 2007 5:09 am

I would love to see more primitives in indigo too, but recognize that it is not high on OnoSendai priorities. I've used POV-Ray for over 15 years and really like the beauty of pure geometric forms. If you look at POV-Ray (and seriously, any computer graphics enthusiast should work with it for a while) it has over 20 primitives. A skilled artist (I'm not one) can create realistic scenes using only primitives and Constructive Solid Geometry (CSG). :) http://www.povray.org

I believe currently Indigo has two primitives, an infinite plane and the sphere. If more primitives were added it then we'd also want CSG functions like difference, union, and merge. That I expect is a lot of work.

The most powerful primitive in POV-Ray is the isosurface. You can essentially create an almost infinite variety of primitive shapes using a formula. I'd like superellipsoid, taurus, isosurface, and Julia fractal, but Indigo wasn't created to be a new and improved POV-Ray. The idea was a rendering engine to use with mesh based modeling programs, not script based CSG modeling.

Still I'd love to have some more primitives :) and the reality is that many of us like to tweak/modify our scenes in XML. Again, a big help toward a more powerful use of scripting in XML is to save mesh geometries from modeling programs as objects that can be reused in other scenes. The Blender exporter for 0.6 had the option to save geometries separately (although not as individual objects) from the scene description, but that was dropped in the current version of the Blender exporter for 0.7.

Whether more primitives are added or not we all owe a big thanks to OnoSendai and the others that have contributed to Indigo :D

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sat Feb 10, 2007 5:32 am

YES!
You're right:
These are missing in our list:
Taurus and different fractals with a value of how often it should be repeated^^
But, what do you mean with IsoSurfaces?
Also, you're right, these things are created by formulas...
So, maybe, it would be useful to add a primitiveformula part, like:

<primitive>
<name>PrimitiveName</name>
<var>_(put in Variables, seperate with ";")_</var>
<formula>_(put in formula here)_</formula>
<materialname>_(put in Material Name)_</materialname>
</primitive>

....or something like this.

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Sat Feb 10, 2007 6:57 am

OMG what did I do :mrgreen:
Again, a big help toward a more powerful use of scripting in XML is to save mesh geometries from modeling programs as objects that can be reused in other scenes.
Hey, that's what obj support is for ! Export objects as obj files, and call thel into the scene via the xml code (see 0.7t4 doc). Otherwise, nice support to my suggestion silverman ;)
If more primitives were added it then we'd also want CSG functions like difference, union, and merge.
That's already working for specular with medium, see my last image. So union and difference is not a problem, only intersection is missing, but I think that technically that would not be that difficult, it's basically about testing wether a surface is within another sharing the same mat or not (I think).
Indigo wasn't created to be a new and improved POV-Ray.
I would love to see more primitives in indigo too, but recognize that it is not high on OnoSendai priorities.
Agreed ;)

Post Reply
17 posts

Who is online

Users browsing this forum: No registered users and 5 guests