9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Pietro Gagliardi <pietro10@mac.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Attempt at making 3D graphics library
Date: Sat, 24 Nov 2007 09:19:43 -0500	[thread overview]
Message-ID: <AC72DF40-C021-48F2-ADBD-D99C28E9CE42@mac.com> (raw)
In-Reply-To: <6C91D0B5-0452-402A-8BE2-35F564C5E755@telus.net>

On Nov 24, 2007, at 1:57 AM, Paul Lalonde wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> It's hard to tell what might be wrong with your transformation if  
> you don't also show the transformation matrix you are using,  
> including the camera parameters.  What you probably want is for  
> your transform to go from some world space coordinates (your 5,5,5)  
> to screen space.  It's also not clear if you are expecting device  
> coordinates (0..1023, 0..767) or normalized coordinates (0..1,  
> 0..1).   Your resulting coordinates aren't too far off for some  
> camera vaguely pointing at the origin and a device coordinate  
> transformation matrix.
>
> Paul
>
>

I was using no transformation matrix. I'm also thinking I'm getting  
the screen width and height wrong. Either way, there are formulae in  
the middle of that article, reproduced here:

.EQ
x sub { 2d } -> x sub { 3d } * { N over z } + { { screenwidth } over 2 }
.EN
.EQ
y sub { 2d } -> y sub { 3d } * { N over z } + { { screenwidth } over 2 }
.EN

It also says at the top that z=N and because equivalence is  
bidirectional that N=z. I do expect device coordinates.

I remember a while back about a discussion on 3D graphics  
programming. Andrey said that OpenGL was ported a long time ago but  
was never tied to rio or 8 1/2. He also said that it would be doable  
but difficult via APE. Unfortunately, I don't know how to program  
OpenGL, and by the code I've seen to produce a single object in a  
display I'm afraid of approaching it. I was hoping my simple point  
conversion mechanism would light a spark. Guess I'll try again later :-)


  reply	other threads:[~2007-11-24 14:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-24  3:43 Pietro Gagliardi
2007-11-24  6:57 ` Paul Lalonde
2007-11-24 14:19   ` Pietro Gagliardi [this message]
2007-11-24  7:11 ` anyrhine
2007-11-24 16:42   ` Pietro Gagliardi
2007-11-24 15:57 ` Pietro Gagliardi
2007-11-24 16:00   ` andrey mirtchovski
2007-11-24 16:21     ` Pietro Gagliardi
2007-11-24 22:48       ` Federico G. Benavento
2007-12-30 16:33         ` Pietro Gagliardi
2007-12-03  2:54 ` Pietro Gagliardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AC72DF40-C021-48F2-ADBD-D99C28E9CE42@mac.com \
    --to=pietro10@mac.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).