Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: mperdue@hrtc.net (Mario Perdue) Newsgroups: scea.yaroze.programming.3d_graphics Subject: Re: Wireframe stuff Date: Thu, 04 Sep 1997 04:02:51 GMT Organization: SCEA News Server Lines: 36 Message-ID: <340e2b7f.44816938@205.149.189.29> References: <33DFD095.4CA05698@ix.netcom.com> <33e022f2.49958763@205.149.189.29> <340E1D81.12A0@objectpeople.on.ca> NNTP-Posting-Host: firewall.hrtc.net X-Newsreader: Forte Free Agent 1.1/32.230 On Wed, 03 Sep 1997 22:31:29 -0400, Wilf LaLonde wrote: >Mario Perdue wrote: >> >> ... To do a perspective projection. You can use the >> following: >> >> x_screen = d * x/z; >> y_screen = d * y/z; >> >> where: >> >> x_screen, y_screen is the screen location >> x, y, z is the 3D location >> d is the viewing distance from the screen >> >But this won't work if you want to draw 3D lines on top of >existing 3D objects (e.g., to SELECT it). You need the >correct camera to screen transformation that is buried >somewhere inside the renderer. Perhaps you know how >to get hold of it??? Wilf, That's not the question I was answering, but the transformation should still work. You would have to first transform your real world coordinates into viewspace coordinates, then apply the perspective transformation. However, I would think that you could use GsGetLs() to obtain a local-to-screen xform matrix for the object in question. Then you could apply that matrix to the points on the object that you want to connect with lines. I havn't tried this, but it seem reasonable. Mario