From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <6C91D0B5-0452-402A-8BE2-35F564C5E755@telus.net> References: <217E2E30-ED7F-40A8-9C11-7D0689255996@mac.com> <6C91D0B5-0452-402A-8BE2-35F564C5E755@telus.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Pietro Gagliardi Subject: Re: [9fans] Attempt at making 3D graphics library Date: Sat, 24 Nov 2007 09:19:43 -0500 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: 09f62432-ead3-11e9-9d60-3106f5b1d025 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 :-)