Path: chuka.playstation.co.uk!news From: Robert Swan Newsgroups: scee.yaroze.beginners Subject: Re: Plotting 2D Boxes in a 3D World Date: Thu, 14 May 1998 04:41:30 +0100 Organization: I wish! Lines: 37 Message-ID: <355A67EA.137C@mdx.ac.uk> References: <355a3dc2.2999054@news.playstation.co.uk> NNTP-Posting-Host: nova.mdx.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (X11; I; SunOS 5.5 sun4u) Hi Richard, I was wondering when Id see your presence on here after onedotzero... I also have to say I think you're progressing pretty darned fast, which is nice to see. What is happening is this - normal screen coordinates are (0,0) top left of screen to (320,240) bottom right, but when you use initialise the screen for 3d graphics with GsInit3D(), then the origin moves to the center of the screen, so all you have to do is draw your rectangles from (-160,-120) to (160,120)!! PS, I think from what James Shaugnessy found out that there is a quicker way of drawing one by one dots, and that is to have a 1x1 pixel large sprite, and use that instead of boxes. You can alter the r,g,b member attributes of the GsSPRITEs to get different hued dots. Although, thinking about it now, James was not using boxes in the first place, so maybe its worth checking if sprites are faster. Robert Swan rs108@mdx.ac.uk http://www.netyaroze-europe.com/~middex2 (btw, you put your web site up at 1am. Im replying to this at 4.49am. Im staying up all night at uni (yawn)) Richard Cutting wrote: > > I'm writing a 3d shoot em up game and I want the background to be a > pretty backdrop of stars. I've coded the stars as 1 * 1 rectangles > which get bunged into the OT using GsSortBoxFill. They are being > displayed but what is happening is that they are all appearing in a > small box in the lower right hand corner of the screen. I am assigning > each star random co-ordinates using something like x = rand()%320, y = > rand()%256. I know that I have to do something to the co-ordinates to > map them into 3d space ( i.e the whole screen ) but I cannot determine > what. Can anyone help please !!!