realbasic-nug
[Top] [All Lists]

Re: Draw a line in 3D space

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Draw a line in 3D space
From: Frank Condello <developer at chaoticbox dot com>
Date: Wed, 5 Jan 2005 14:57:30 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BE01CEBA dot D52E%barney at custombased dot com> <7E1A7598-5F20-11D9-AB01-000D936CA66A at gsco dot de>
Lines work just fine in RB3DSpace, but they have a fixed thickness and you need a modeller capable of saving line primitives in 3DMF format (I never come across a modeller that will actually do that). You can create lines from scratch with declares* however, but the fixed thickness limits their usefulness. Declares directly to OpenGL will give more control over such things, but the setup code is more complicated.

If all you're doing is drawing a line or two, you can calculate the projection yourself and draw into a canvas. Google for "3D projection math" or "3D software rasterizer" but be prepared for some deep math.

Frank.
------------
Open Source RB Plugins and Classes
<http://developer.chaoticbox.com>

*Visit the link above for some RB3D projects, including the Quesa Wrappers which allows you to create 3D lines from scratch. The PrimitiveConstructor.rb project has examples of how it's done.

On 5-Jan-05, at 8:48 AM, Frank Bitterlich wrote:

Hi Barney,

I'm not exactly a 3D specialist, but until someone with real knowledge speaks up, here's my comment:

A line is a one-dimensional object, and as such doesn't exist in a RB3DSpace. What you want is probably a (very narrow) cylinder, I suggest you create one in any 3D program (like Joe Strout's "Meshwork"), an import that as an Object3D (via .AddShapeFromFile()). The simply rotate and transform it using the Quaternion and Vector functions of RB.

Cheers,
   Frank+++


Am 05.01.2005 um 05:04 schrieb Barney:

Hi,

Given a start point X,Y,Z and an end point X,Y,Z of a line...

What's the best way to go about drawing this into
a 3D space so it can be viewed on screen, rotated, orbited around
etc.

Just curios to know how others might go 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>

<Prev in Thread] Current Thread [Next in Thread>