# Putting one geometry in the frame of another

This topic is 5128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello everyone, im trying to tackle a problem in which I have to define specific regions of a geometry based on another geometry. Let's say for example, I have a double sided wrench (you should all know what one of these looks like), based on another geometry which acts a reference (to show what region is the handle or where the head is) how do I put the reference geometry in to frame of the other geometry ???

##### Share on other sites
I'm not sure that i understand what you are asking but have a look at the stencil buffer, it may be able to do what you want to do.

Are you saying you want to mask out where to draw with 3d geometry, not rendered there means dont render the second mesh here either?

##### Share on other sites
I'm not exactly sure what you're asking, but I'll give you a quick 'basic' answer. If you already know this stuff, nevermind, but otherwise...

It sounds like you want a hierarchical system of objects, each with its own local coordinate system. 'Child' object are defined in their parent's coordinate system.

The classic example is a car with four wheels. The car body is the parent (the top node in the tree), and has a local coordinate system that is defined in respect to the world coordinate system. Each wheel is a child, and has a local coordinate system which is defined in respect to the body's coordinate system.

A coordinate system can be represented in a few different ways - common representations are 3x4 or 4x3 matrix, 3x3 matrix and vector, or quaternion and vector.

If I totally missed the mark, maybe you can rephrase the question or let us know more specifically what you need.

##### Share on other sites
jyk -- I think you're on the right track let me try to draw out in 2d (even though this is for a 3d app) what I'm getting at:

Lets say this is the geometry of a bolt, where we have the shaft and the head

|-----------|____| <-------

And we have this reference geometry which would indicate where the head and the shaft are

------(--)---(--)
------(--)---(--)

The head of the bolt is between these two rings

I want to be able to identify on the bolt geometry the areas of the bolt based on th reference geometry. Does this make sense???

Im sorry that my ascii art sucks

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 17
• 14
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634097
• Total Posts
3015505
×