Xojo Conferences
XDCMay2019MiamiUSA

Re: Quesa Polyhedrons (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: scroll multiple editfields
Next thread: RemoteDebuggerStub Linux


Couple questions regarding printing   -   Harrie Westphal
  Re: Quesa Polyhedrons   -   Joseph J. Strout
   Re: Quesa Polyhedrons   -   Lars Jensen
    Quesa Polyhedrons   -   Thomas Moore
    Re: Quesa Polyhedrons   -   Frank Condello

Re: Quesa Polyhedrons
Date: 01.08.05 15:24 (Mon, 1 Aug 2005 08:24:31 -0600)
From: Joseph J. Strout
At 3:21 PM -0700 7/30/05, Thomas Moore wrote:

>I am trying to write an educational 3D program that uses arrows to
>represent vector quantities. I want to use a pyramid to represent
>the arrow's tip, but I am having a terrible time constructing a
>realistic-looking pyramid object. I have tried constructing a
>pyramid using Meshworks

It's Meshwork, and I would expect that to be the easiest way.
Assuming you want a four-sided pyramid, the steps would be:

1. Start with a new document.
2. Click the Grid button in the toolbar to turn on a grid.
3. Select the Line tool.
4. Click the four corners of the base, clicking back to the first
point to make a square, and then across to the opposite corner to
join this with two triangles.
5. Select All, then click in the center (to make the top of the pyramid).
6. Using the location fields in the toolbar, type a nonzero Z value
-- say, 100 -- to move the center point up out of the base.
7. Select All, and use the Face Out command to make sure all
triangles are facing out.
8. Save, and then Export to 3DMF.

That should do it. I'd be happy to send you one if you like, but if
you do it yourself, then you can tweak the dimensions to taste.

>and have tried using Quesa declares to create a polyhedron object.
>After a lot of effort with the latter, I have managed to create a
>pyramid polyhedron whose faces all point appropriately outward and
>whose shape looks correct, but the face shading when rendered does
>not look right. Each flat face of the pyramid *should* have a
>uniform brightness when illuminated by a floodlight (since each
>makes a fixed angle to the unidirectional floodlight illumination),
>but this is not so.

Ah, true, Quesa interpolates shading even when you have not specified
vertex normals. It differs from QD3D in this respect. To work
around this, you actually have to duplicate each of the four top
sides of the pyramid, moving each one out of your way as you do so,
and then delete the top vertex. Then move the four sides back into
place. Then, do NOT use the "Combine Overlaps" command -- you need
the overlapping vertexes to be uncombined, so that shading won't
interpolate across them.

Again, I can send you an example if you wish.

Best,
- Joe

Re: Quesa Polyhedrons
Date: 01.08.05 18:34 (Mon, 01 Aug 2005 13:34:02 -0400)
From: Lars Jensen
> It's Meshwork, and I would expect that to be the easiest way.
> Assuming you want a four-sided pyramid, the steps would be:
>
> 1. Start with a new document.
> 2. Click the Grid button in the toolbar to turn on a grid.
> 3. Select the Line tool.
> 4. Click the four corners of the base, clicking back to the first
> point to make a square, and then across to the opposite corner to
> join this with two triangles.
> 5. Select All, then click in the center (to make the top of the pyramid).
> 6. Using the location fields in the toolbar, type a nonzero Z value
> -- say, 100 -- to move the center point up out of the base.
> 7. Select All, and use the Face Out command to make sure all
> triangles are facing out.
> 8. Save, and then Export to 3DMF.

Or you could replace steps 2-7 with:

2. From the menu bar, select Create->Cone...
3. Set Sides = 4 and click OK.

(When I needed a 3D arrow, I used an 8- or 16-sided cone so its appearance
wouldn't change much depending on my viewing angle. I also smoothed its
texture for the same reason.)

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Quesa Polyhedrons
Date: 30.07.05 23:21 (Sat, 30 Jul 2005 15:21:54 -0700)
From: Thomas Moore
I am trying to write an educational 3D program that uses arrows to
represent vector quantities. I want to use a pyramid to represent the
arrow's tip, but I am having a terrible time constructing a realistic-
looking pyramid object. I have tried constructing a pyramid using
Meshworks, and have tried using Quesa declares to create a polyhedron
object. After a lot of effort with the latter, I have managed to
create a pyramid polyhedron whose faces all point appropriately
outward and whose shape looks correct, but the face shading when
rendered does not look right. Each flat face of the pyramid *should*
have a uniform brightness when illuminated by a floodlight (since
each makes a fixed angle to the unidirectional floodlight
illumination), but this is not so. Instead, one of the base vertices
of the pyramid is bright, and the brightness of the base and the two
triangular faces connected to that vertex varies (each face is
brightest close to the vertex and dimmer farther away). The
illumination of the bright vertex seems to be coming from a direction
that makes a 45 degree angle with the actual floodlight.

A simple box created by a Quesa declare in the same field of view and
floodlight displays as expected.

I am guessing that there must be something special about the way that
polyhedra are rendered that makes them serve as better approximations
for smooth things like heads or something like that. Is there any way
that I can adjust edge or vertex attributes to make the pyramid look
more like a collection of flat faces?

Thanks for any insight!

Tom Moore

RB2005r1
Mac OS X 10.4.2
Quesa 1.7

PS. I wanted to use pyramids for the vector tip because I guessed
that an object having only five faces would render more quickly than
something more complicated like a cone. Am I correct about this?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Quesa Polyhedrons
Date: 31.07.05 01:25 (Sat, 30 Jul 2005 20:25:41 -0400)
From: Frank Condello
On 30-Jul-05, at 6:21 PM, Thomas Moore wrote:

> ...Each flat face of the pyramid *should* have a uniform brightness
> when illuminated by a floodlight...

There's two ways to do this:

1) Don't share vertexes, and submit normals with your mesh. So
instead of 4 vertexes to define the pyramid use 12 (3 per triangle)
and assign normals to each equal to the facet normal.

2) Apply a "none" interpolation style to the geometry (with declares).

> PS. I wanted to use pyramids for the vector tip because I guessed
> that an object having only five faces would render more quickly
> than something more complicated like a cone. Am I correct about this?

Depends - a highly subdivided cone may take more time to render, but
performance in Quesa tends to degrad more as the object count goes up
rather than the triangle count. So 100 pyramids may actually render
at the same speed as 100 cones using 3 times the triangles.

Also, you can create a 3-sided cone using the built-in cone primitive
and a subdivision style. Grab my Quesa Wrappers project (here:
<http://developer.chaoticbox.com/>) and check the
"StylesAndIllumination.rb" example project. It creates a cylinder
where you can dynamically alter the mesh resolution with a slider. It
works the same way for a cone, and if you use this approach you can
allow people to change the resolution at runtime to trade visual
quality for performance, or even have the mesh modify itself
dynamically depending on the distance from the camera (continuous LOD).

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>