Inside3D!
     

Print something to a polygon/entity?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Mon Oct 27, 2008 8:58 pm    Post subject: Print something to a polygon/entity? Reply with quote

Is it possible to print a message into polygon? I'm thinking of leaving the HUD away and have a wrist console that tells player how much health, armour, etc, he/she got.

I don't really like the idea that I'd have to make 3 polygons/entities if I wanted to have a 3 number display, then repeat this for all stats I want to have displayed... Maybe that's ok if it's just one counter in a weapon, that don't need 3 numbers, just 2.

If not possible, I'll just do something simpler.. Like some color gradient box polygon that change color and/or size...
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Oct 27, 2008 9:10 pm    Post subject: Reply with quote

how many different skins am I allowed to use?....

Well, you could use attachments and join multiple models together to form a single view model, changing the skin to set the number shown on a per-character basis.

Alternatively you could use DP_GECKO_SUPPORT... but that's not really practical.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Mon Oct 27, 2008 9:53 pm    Post subject: Reply with quote

hehe do what they did in that new game Dead Space, i saw a preview and they put the health bar on the main characters back

well, hm that wouldn't work for the ammo though Confused
_________________
bah
Back to top
View user's profile Send private message AIM Address
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue Oct 28, 2008 9:48 am    Post subject: Reply with quote

jim: There's always polygon-drawing available in CSQC...
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Wed Oct 29, 2008 1:02 pm    Post subject: Reply with quote

What does that polygon drawing do? Can it draw multiple different textures into one polygon and have them at different coordinates in it and have some scale adjustment? Would it be able to write a message into the polygon.. like when player receives a message, then print it in that polygon instead of upper left corner or center of the screen?

Then I could make the game send long spam letters into player's wrist console Twisted Evil

Could this text scroll up and down if it didn't fit well enough into the wrist console display?

For player stats, I would like to have a picture of a simple human body that is separated into some areas, then maybe some lines drawed from the parts. This would be a backdrop, this wouldn't animate (but maybe the different parts could change colour). Then I would have 6 or 7 number values from 0 to 100% to indicate the status of a body part. The lines would "connect" these to the body parts.

Code:

                       ___
                      /   \     HEAD 100%
                      |- -| ------------|
                      \ - /
 R. ARM 100%        ___|_|___        L. ARM 100%
 |------------ ____/  /   \  \____ ------------|
              |______|     |______| 
                      \___/ 
     L. TORSO 100%    /   \ \__   U.TORSO 100%
     |-------------- |     |   \-------------|
                    / \___/ \
  R. LEG 100%      /   | |   \      L. LEG 100%
  |--------------- |   | |   | ---------------|
                   |   | |   |
                 __|   | |   |__
                |______| |______|


Or maybe even draw the stuff in ascii like this...
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Wed Oct 29, 2008 2:39 pm    Post subject: Reply with quote

The polygon drawing in CSQC does just what you'd imagine it does, it draws polygons. In other words, yes, you could make Doom3 like screens if you like. But the point is that you really need to code all of it yourself, but the possibility is there.

It doesn't quite work the way you imagine it, it doesn't alter the texture on a given polygon, but rather, you can draw new polygons with a slight offset from the surface you want them to be displayed on. This is, simply, how polygons work. It's very rarely necessary to alter the texture, but rather, new polygons are drawn in front of it, with such a minor offset that it's impossible to spot. This is how decals in games are done. This is also how the Doom3 screens were done.

You'd need to somehow indicate the position, size and direction of the surface you want to show your offscreen HUD on (I recommend either by using the getsurface* builtins, or by external files which point to a certain tag on a model, together with info for surface size), and draw your 3D HUD based on that information, clipping the polygons and aligning the textures based on the direction and size of the surface. Depending on your level of knowledge about polygon drawing, this is either easy or hard, but in any case a time-consuming task.

All of the features you describe would be perfectly possible, but don't imagine it to magically work, you have to code all of it, the scrolling, everything. The difference with CSQC and SSQC, is that things like this are finally possible.
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Oct 29, 2008 9:46 pm    Post subject: Reply with quote

Tbh, I forgot about the polygon rendering stuff.

Urre wrote:

You'd need to somehow indicate the position, size and direction of the surface you want to show your offscreen HUD on (I recommend either by using the getsurface* builtins, or by external files which point to a certain tag on a model, together with info for surface size), and draw your 3D HUD based on that information, clipping the polygons and aligning the textures based on the direction and size of the surface. Depending on your level of knowledge about polygon drawing, this is either easy or hard, but in any case a time-consuming task.

If its a skeletal model, tags are the way to go if you want to animate the model properly (warning: DP's gettaginfo doesn't interpolate, but its easy enough to make a fix for that).

Assuming you want your hud to form a square on an animating model, the cleanest way is to use 3 bones and to extrapolate the fourth. The area to be drawn into should have any pre-made polygons missing. You then want to draw your hud as a series of triangle-pairs in the space. Try and avoid overlapping as inaccuracies will show then. Also reuse calculated vertex points for multiple polys (that is, figure out all the subcoords as the first step, and just draw polys with the given textures in the second.

This isn't drawing on the model, this is using CSQC to actually draw part of the model itself.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Thu Oct 30, 2008 8:18 am    Post subject: Reply with quote

Spike: Shouldn't it be possible to have the polygon pairs overlap with a small offset on those that are meant to be drawn in front of the background polygons? I'd imagine it'd be easier to code, even if you wanted multiple layers, just add more offset depending on what layer the elements are on?
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Thu Oct 30, 2008 3:19 pm    Post subject: Reply with quote

Maybe I'll do something simpler, and I just realised that displaying the hud in some wrist console would be a minus if player has it compared to when he doesn't have it. And I wouldn't want to leave the hud completely away when wrist console not in possession.

But I think for weapons it's fine to leave the ammo counter completely away in some old fashioned weapons, and then have some displays in new age weapons.

Oh and I'll probably have to take a look at csqc anyway, so is this stuff here up to date: http://quakery.quakedev.com/qwiki/index.php/EXT_CSQC ? And is it all?
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Fri Oct 31, 2008 9:43 am    Post subject: Reply with quote

It is relatively up to date, but it is far from all. Your best bet is to use one of the available CSQC source bases, and just experiment your way forward, in order to learn CSQC.
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group