i m doing color picking for my project, i m working with iphone sdk and my project substantially(for color picking part) load 3d models with texture, the "loader" own an array of objects, those objects are presented with drawView and are updated with redrawView. When i click with mouse on the iphone simulator i just call the method drwanWithOneUniqueColor
that should color each object in the array with one different color.
The result with number of models 3 so with array model count = 3 is: on the view just 1 object with 1 color , in a different position where was the object( in front of the view ) and under 3 models with texture and the 2 and 3 model are not colored why?
THE OBJECT VIEW
and
THE LOADER AND REDER OBJECTS
http://pastebin.com/LHpmFAzn
i m working on and i m discovering that models was well colored but attached one on the other
in this way i could see just 1 of them.
now i should resolve the question of translate in the right way the objects.
Related
I have .obj file of truck where I want to assign a texture to tyres.
I am doing this in blender:
select the vertices/faces of tyres
split it into different object (using P)
assign a texture file to the new object
combine the new object back to the main object using Ctrl+J
The problem is the texture file is not preserved and the whole model is assigned one of the texture files.
How can I assign the texture to just tyres?
Make a new separate material and select the vertices of the tire,
then click 'Assign' to assign that new material to the selected vertices.
See image here
I'm implementing the class diagram where the users can change the class' name, attributes and methods. I'm having trouble with resizing the class rectangle width depending on name, attribute or method length. These can overflow and go outside the rectangle, and I just can't find a method to get the correct size.
I also have added an element tool to the elementView, and set its x and y to "100%". According to documentation: "Use percentage strings (e.g. '40%') to position the button relatively to the element width/height." but I guess this isn't the model's size, as I typed JSON.stringify(graph.toJSON()) and got the following.
JSON.stringify(graph.toJSON())
The size is the default value I set (260x100).
I checked the size of the attribute using DevTools:
Size of attribute
The gray button detects the width number I need (330), so I guess that the x in element tools is the elementView's width. I looked at the documentation and can't find any method like .size() or .getSize() for the elementView. I need to resize the rectangle to the size of Max(name length, attribute length, method length) + some aditional space to not look cramped up. I have seen some solutions like "Use [number of letters] * [some constant]" but that is no good as typing 5 "W"s doesn't take the same space as typing 5 "i"s.
So how do I get the width of the whole element (in my case 330 from text length + the three pixels from the left border of the rectangle to the first text letter)?
Okay, so after searching through several Google Groups chats I found some pieces of code that helped me.
For getting the width I needed, I used elementView.getBBox().width.
Where I didn't have the element view right at hand, I at least had the model ID, and so I used paper.findViewByModel(modelId) to get the element view.
I'm trying to implement YOLO-V1,but I got some problem when create labels.
YOLO-V1 has 2 bounding box, so, when a grid has an object, how to choose which bounding box to put location information?
For example:
Follow YOLO paper, normalized location of an object in a grid is [0.5, 0.8,.7, 0.9]
how to prepare this 1x1x30 tensor?? More specifenter image description hereically label for Bounding box-2 ??
This is for labelling not for testing!!!
Thank You
The first element in each boundary is 0 or 1 which refers to the existence of an object in this boundary box ( the cell called p in your picture). The loss function changes depending on p according like this: so if p is 0 it doesn't consider the locations at all.
It's implemented this way to be able to detect overlapping objects in the same box as illustrated in this image
I want to make a Rubik's cube with VPython and I've faced a problem in the first stage! I want to color every face of a box with a different color but I can't find that! In the tutorial you only can color all of the faces of the box with one certain color!
What should I do?
Note: I'm using VPython 7 and Python 3.6
You can also make a box with different colored faces using a compound object made up of 6 pyramid objects each of a different color.
def cubelet(....): # a "factory function"
#create a list of the 6 pyramids with different colors; suppose its name is L
L = [pyramid(color=color.red,pos=vec(),axis=vec()), ... ]
return compound(L)
c = cubelet(....)
This "factory function" (a function that returns an object) returns an object that has the usual properties of primitive objects such as box. You can manipulate this compound object by changing c.pos or c.axis, etc. You can create copies of this cubelet:
c2 = c.clone(pos=vec(10,5,0), size=vec(2,1,0.2))
For pyramid see documentation
http://www.glowscript.org/docs/VPythonDocs/pyramid.html
Just arrange 6 of these in the shape of a box. For compound object see
http://www.glowscript.org/docs/VPythonDocs/compound.html
to make a compound object out of 6 pyramids.
You can try make a box with different color faces out of 6 boxes similar to what is shown in this demo, where the box has red blue and grey faces.
http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/Bounce-VPython
You can also make a compound object out of a number of objects.
http://www.glowscript.org/docs/VPythonDocs/compound.html
So you can make a compound object called multicolored box made out of six boxes of different colors.
You can also try creating your own box out of triangles and/or quads and color each face.
http://www.glowscript.org/docs/VPythonDocs/triangle.html
I'm new to Unity and I started with the Catch Game Tutorial to learn to create a 2D game. Everything is working now but for my needs, I would like to add different textboxes to each of the fallen elements (in the tutorial the bowling balls) Those texts should move with the objects. I know I can change text dynamically in the code, but I couldn't figure out how to correctly add the element.
I tried to add a text object as a child of the gameobject and also tried to create a new gameobject which contains a text, but I can't position the element in front of the background and above my wished element (I can't choose a sorting layer for this)
Imagine this is the object which has to be collected and I would like to show a text like this:
My Questions are:
1. How can I add a text to be displayed in the correct position (GUIText, text in a gameobject, only text or something else?
2. How can I make this text dynamically move with the fallen object?
3. Can I set a background to my text as displayed above?
Thank you in advance!
I found a solution for my problem and did the following thing:
I created a Sprite with my wished background (black rectangle) and added it to the scene
I created a 3D Text and added it as a child to the created Sprite (and scaled it and positioned it)
I added a Script to the 3d Text with the following content:
void Start () {
this.gameObject.GetComponent<Renderer>().sortingLayerName = "[MyLayerName]";
this.gameObject.GetComponent<Renderer>().sortingOrder = 3;
}
I added the Sprite (with the text as child) to my gameObject (ananas)
A renewed the object in the Prefabs folder
Maybe my solution helps other people facing a similar problem.