Sign in to follow this  
Jackbunny

Slicing shapes

Recommended Posts

I put this as part of a post on a game programming thread, but I decided it might have a better place here. Long story short I'm trying to create a type of boundry around several objects in three dimensional space. One possibility I have arrived at is placing a directx generated sphere around these objects. I have three questions involving this. First of all, it is possible to make the sphere partially transparent correct? I assume this could be done by altering alpha values of textures like anything else. How much would having many of these spheres rendering on the screen affect frame rate? Third question (and really the most important) is there are situations where the sphere couldn't extend all the way in one direction but it could in another. Is it possible to slice or squash the sphere on one side only? Thanks so much in advance.

Share this post


Link to post
Share on other sites
It is possible. A DX generated sphere is probably the easiest way. You can also set some render states and texture stages to make it transparent too, instead of touching the vertices or textures (unless you create the texture in another program and make it transparent, which is easiest). Define Many and How big? It's probably not going to affect it enough to worry about it, as long as you batch them up and use the same textures. You will have to sort them since they'll be translucent. I don't understand the third question. If you want to deform the sphere, it could be done with the proper code easily enough. Draw it out and experiment. There's not going to be any helper functions to slice the sphere though, to my knowledge.

Chris

Share this post


Link to post
Share on other sites
Quote:
Original post by Jackbunny
Third question (and really the most important) is there are situations where the sphere couldn't extend all the way in one direction but it could in another. Is it possible to slice or squash the sphere on one side only?

You'll need to do CSG (Constructive Solid Geometry) - i.e. write a CSG implementation that can slice meshes with planes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this