Need dynamic texturing help/suggestions.

Incoming wall of text; but this is a problem i am just not sure how to solve.

I am working on a space style flight sim and am at the point where shooting/ai etc all works. Now it is time for the textures on the screens as in the screen shot. (lol programmer art but i’m learning!)

First some background on the model, was made in Maya where even though the cockpit is full of polys and not smooth, made the screens a simple plane and made the UV coordinate (0,1) x (0,1), such that it would be fairly easy to texture them in the future via setTexture().

Two problems so far:

(1) - I want to make a radar on one of the screens. Getting the actual positions from the cockpit is really trivial; but the problem is the texturing. My initial thoughts were multitexturing , where each layer would be a blip with the bottom layer being the classic green circle. Problem here is; i wouldn’t be able to have more than the allotted multi texture limit for the graphics card (lets assume it to be like 4), which limits the capabilities greatly.

To exploit this i could just put multiple planes on top of each other, slightly offset towards the camera, so i would have n planes * 4 number of blips; but there MUST be a better way (off screen rendering perhaps??)

(2) - I want to make the top left screen like a speedometer, except represented in vector form where it shows your speed in each corresponding component.

Problem here is i need some means to go from string -> texture. I have used some GL libraries before that change strings to geometry, which i suppose i could render these off screen take a snapshot and use that as a texture.

Now another approach i have though of taking, is instead of having the cockpit be an actual 3-D model, make a snapshot inside of Maya and have the cockpit be one texture where the windows are just alpha. This seems like it would work, such that i can exploit all of the aspect-2d stuffs, but i wonder if i would lose that perspective having it in 3d would offer?

Any suggestions or ideas would be greatly appreciated,

If you look through the examples that come with Panda the ‘Teapot on TV’ does exactly what you want, except you need to use 2D rather than 3D for the teapot bit, and once setup you can just use the DirectGUI stuff to render your interfaces. To do the 2D I guess you would setup an orthographic camera, looking along the z axis, but I suspect panda might have a better way of doing that which saves the tedium, seeing as it creates such a thing automatically for the main scene - hopefully someone else can fill you in there. Chapter Q (Render to Texture) in the manual is the relevant chapter for doing this, but doesn’t really contain enough info right now.

have you already checked this ?
It uses a couple of features that I guess matches your needs.

Ok cool, looks like getting the radar to work with a texturebuffer would be pretty simple, and cool looking because i can make the radar 3d and cool 8).

I am still at a quandary on how to go from string->texture. Is it possible to instance out aspect2d onto the altBuffer? Or to use some module like OnScreenText onto the altBuffer (would make it terribly simple :stuck_out_tongue: )?

aspect2d is not much more than a normal 3-D scene graph with an orthographic camera instead of a perspective camera. (It’s a little bit more than that, to provide the mouse interactivity with DirectGui objects, but if you don’t need those services then don’t worry about that.)

So, just as lethe suggested, if you’re already creating a 3-d offscreen buffer, you can just as easily create a 2-d buffer for rendering out your text.


Oh yeah–if your text requirements are not complex, you can also use the PNMTextMaker class to assemble text directly into a PNMImage (which you can then load into a texture). It’s not as powerful as the full-force TextNode implementation, but it does all right for simple things, and it might be easier to use than creating an offscreen buffer.


Oh i did not know about PNMTextMaker. Maybe i should give that one a try