Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / Multiple different questions about 3D

Author
Message
Harvester
21
Years of Service
User Offline
Joined: 17th Sep 2004
Location: Infront of my computer
Posted: 11th Nov 2004 07:39
As I'm sure you know by reading this post's name, I have a few different questions about 3D, and I figured it would be better to put them all into one post instead of make 2-3 posts all at once.
So here are my questions :

Is their a way to get the Z position of the mouse? I know the mouse doesn't actualy go "into" the screen, but I have your typical RTS game view, and I want to use the mouse to select units on-screen. The problom is, I can't find out how "deep" into the screen the mouse is, so if you click the mouse and it has an x value of 60 and y of 60, then all units with those values would end up being selected, even if some of them were off-screen. I have seen a few things about a PICK OBJECT command, but I have no idea how this command works, or if it is included in dbc(which is what I am using)

Next question :

I have a model, made and painted with calagari truespace 3.2. When the model is loaded and the screen resolution is set at 640 by 480, the model keeps its paint information from calagari, but it doesn't on higher resolutions . The model is saved as .x. I would really like to have resolutions above 640x480, but not if I have to make textures for all the models in my game.

Please keep in mind that I am fairly new to using 3D commands, and that I am using DBC.

All help is appreciated, thanks.
IanG
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 12th Nov 2004 05:08
the z position of the mouse is the scroll wheel if im not mistaken

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Harvester
21
Years of Service
User Offline
Joined: 17th Sep 2004
Location: Infront of my computer
Posted: 12th Nov 2004 06:38 Edited at: 12th Nov 2004 10:38
Well dang, your probably right. I hadn't thought of that. Hmmmmmmmmm....I'v been thinking about what I could do if the mouse Z couldn't be gotten(or, as IanG pointed out, it is the scroll wheel) and this is what I came up with. **I take the camera X position, and then based on the mouse location I add or subtract an amount(IE how far from the camera center the mouse is) and then I do the same for the camera Z, only I use the mouse Y location to check that.** The part of the message inclosed in ** no longer matters. I thought about it and realized that it could never work

Someday, I'll finish a game. Until then, I'll just start writting them.
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 13th Nov 2004 08:26
Quote: "Is their a way to get the Z position of the mouse? I know the mouse doesn't actualy go "into" the screen, [snip]

I have seen a few things about a PICK OBJECT command, but I have no idea how this command works, or if it is included in dbc(which is what I am using)"


You're spot on about the mouse not going into the screen so there's not a "real" Z position, but I think you're also on the right track with your PICK OBJECT idea. By putting some "place holder" objects into your 3D scene and finding the closest to the mouse and grabbing it's Z position, you should have a good idea how "deep" your mouse is. I'm afraid I haven't memorized which PICK commands are supported in Classic though (I'm using Pro now), so I've got to refer you to the dreaded manual and it's non-alphabetic (!%$!%#$) command listings
Harvester
21
Years of Service
User Offline
Joined: 17th Sep 2004
Location: Infront of my computer
Posted: 13th Nov 2004 15:03
Sadly, I am pretty sure I read that PICK OBJECT and PICK SCREEN were dbp commands, and not in dbc. The "place holder" idea might work, just let me make sure I understand what it is your saying. Basicly, I would place a bunch of invisible objects around my playfield, and when the user clicked the mouse, I would check which one is closest to the camera, therby giving me something close to the current "Z position" of the mouse. I'll need to use some math to figure out how far infront of the camera the mouse was clicked, but that can only be so hard, can't it

Someday, I'll finish a game. Until then, I'll just start writting them.

Login to post a reply

Server time is: 2026-07-11 02:03:15
Your offset time is: 2026-07-11 02:03:15