Path: chuka.playstation.co.uk!news From: richard.cutting@virgin.net (Richard Cutting) Newsgroups: scee.yaroze.beginners Subject: Re: Plotting 2D Boxes in a 3D World Date: Thu, 14 May 1998 21:10:22 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 61 Message-ID: <355b5c8b.297920@news.playstation.co.uk> References: <355a3dc2.2999054@news.playstation.co.uk> <355A67EA.137C@mdx.ac.uk> NNTP-Posting-Host: p40-crane-gui.tch.virgin.net X-Newsreader: Forte Free Agent 1.11/32.235 Thanks Robert, That works a treat ! I new it had to be something simple in the end and there was me thinking that I was going to have to bugger about with matrices and the like. I have stayed with using boxes for now as I haven't got around to playing with sprites yet ( well I had a go, but we won't talk about that ..... ). What I've done is to package up my starfield routines into a library which is probably completely OTT but now means I can easily create and animate my starfields with a couple of function calls. Its all in my ftp area if anyones interested just check the web page http://www.netyaroze-europe.com/~rcutting. Now its back to fixing some of my game logic which I broke the other day.....sigh...... Richard. ( richard.cutting@virgin.net ) On Thu, 14 May 1998 04:41:30 +0100, Robert Swan wrote: >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 !!!