I simply cannot get the textures to load for my basic 3d models. The model appears but is only in grey.
I am using this model: https://www.turbosquid.com/3d-models/free-max-mode-hammer/384372
I am using the following code.
<a-asset-item id="hammer-obj" src="hammer.obj"></a-asset-item>
<a-asset-item id="hammer-mtl" src="hammer.mtl"></a-asset-item>
<a-entity
obj-model="obj: #hammer-obj; mtl: #hammer-mtl"
scale="1 1 1"
position="0.05 1 -1.90">
My MTL file currently looks like:
newmtl head
Ka 0 0 0
Kd 0 0 0
Ks 0.637 0.637 0.637
illum 2
Ns 2
map_Kd hammer.jpg
map_bump hammer.jpg
bump hammer.jpg
newmtl grip
Ka 0 0 0
Kd 0 0 0
Ks 1 1 1
illum 2
Ns 2
map_Kd hammer.jpg
map_bump hammer.jpg
bump hammer.jpg
I have converted the TIFF file into a jpg as well and that didnt work. I initially had all links to hammer.TIF but I tried JPEG.
Could anyone give me any insight as to what is happening?
Thanks.
If You want to get results 'as expected', my recommendation is the three.json and .glTF formats.
Apparently they are well implemented, and don't cause unexpected behaviour like obj's with mtl's, or sadly fbx's.
In my opinion You should use some blender glTF( 1 or 2 ) exporter, and change the 3D hammer model format, or You could use clara.io, to export it to the three.js json format.
Don McCurdy of the a-frame team recommended using the glTF and json format here.
In fact there is some valuable information there, like how using the material component to texture the .obj with a .jpg works randomly.
You can also find more information on model troubleshooting here.
Related
I have some trouble using CombiTimeTable.
I want to fill the table using a txt file that contains two columns, the first is the time and the second is the related value (a current sample). Furthermore, I add #1 in the first line as the manual says.
Moreover, I add the following parameters:
tableOnFile=true,
fileName="C:/Users/gg/Desktop/CurrentDrivingCycle.txt"
I also have to add the parameter tableName but I don't know how to define it. I tried to define it using the name of the file (i.e. CurrentDrivingCycle) but I got this error message at the end of the simulation:
Table matrix "CurrentDrivingCycle" not found on file "C:/Users/ggalli/Desktop/CurrentDrivingCycle.txt".
simulation terminated by an assertion at initialization
Simulation process failed. Exited with code -1.
Do you know how can I solve this issue?
Thank you in advance!
See the documentation:
https://build.openmodelica.org/Documentation/Modelica.Blocks.Sources.CombiTimeTable.html
The name tab1(6,2) in the example of the documentation is the tableName. So yours should look something like:
#1
double CurrentDrivingCycle(6,2) # comment line
0 0
1 0
1 1
2 4
3 9
4 16
I'm trying to load an .obj which has several .jpgs as textures. My .obj is rendering - but without applying the material.
The .mtl looks like
newmtl material_0
Ka 0.200000 0.200000 0.200000
Kd 1.000000 1.000000 1.000000
Ks 1.000000 1.000000 1.000000
Tr 1.000000
illum 2
Ns 0.000000
map_Kd tex_0.jpg
I assume the path to the .jpgs are correct - if I change it, I see 404 errors in the console.
My aframe code is:
<a-scene>
<a-assets>
<a-asset-item id="moore-obj" src="obj/moore.obj"></a-asset-item>
<a-asset-item id="moore-mtl" src="obj/moore.obj.mtl"></a-asset-item>
</a-assets>
<a-entity
obj-model="obj: #moore-obj; mtl: #moore-mtl"
scale="1 1 1"
rotation="0 0 0"
position="1 1 1"></a-entity>
</a-scene>
The 3D model appears in the scene - but there are no textures overlayed on it. I'm running this on localhost, and I'm not seeing any CORS warnings.
The object is http://www.thingiverse.com/thing:36415
Turns out to be an issue with that particular OBJ file. It uses three materials but it doesn't define object groups for the sub-objects that use each of those materials, so Three.js' OBJLoader doesn't associate the materials correctly.
You can work around it by adding group lines before each usemtl line in the obj file.
For example:
g g_0
usemtl material_0
...
g g_1
usemtl material_1
etc.
For a project im working on i need to know how indesign calculates/generate itemtransform
when the element is not rotated the itemtransform = "1 0 0 1 0 0"
then when I rotate the element 90deg then the itemtransform = "1 -0.5 0.5 1 somecordinate someothercordinate"
open indesign >
new Document >
place an rectangle for example >
save as "enter_name_here".idml >
change the name to "enter_name_here".zip >
extract the files to folder >
open Spreads/spread_ud7.xml in notepad++ and find the itemtransform
now go back to indesign, rotate the rectangle and do the above again, then look at the itemtransform how is that calculated in indesign?
why is that and how is it done if have look in almost every documentation but could not find a clear awnser
anyone have an idea?
Find some info inside this PDF:
https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
i.e. on page 97
I'm planning to use R to do some simple text mining tasks. Specifically, I would like to do the following:
Automatically read each html file within a folder, then
For each file, do frequency count of some particular words (e.g., "financial constraint" "oil export" etc.), then
Automatically write output to a csv. file using the following data structure (e.g., file 1 has "financial constraint" showing 3 times and "oil export" 4 times, etc.):
file_name count_financial_constraint count_oil_export
1 3 4
2 0 3
3 4 0
4 1 2
Can anyone please let me know where I should start, so far I think I've figured out how to clean html files and then do the count but I'm still not sure how to automate the process (I really need this as I have around 5 folders containing about 1000 html files within each)? Thanks!
Try this:
gethtml<-function(path=".") {
files<-list.files(path)
setwd(path)
html<-grepl("*.html",files)
files<-files[html]
htmlcount<-vector()
for (i in files) {
htmlcount[i]<- ##### add function that reads html file and counts it
}
return(sum(htmlcount))
}
R is not intended for doing rigorous text parsing. Subsequently, the tools for such tasks are limited. If you insist on doing it with R then you better get familiar with regular expressions and have a look at this.
However, I highly recommend using Python with the beautifulsoup library, which is specifically designed for this task.
I have a PNG image, the image features a shape surrounded by a transparent area:
I want to recreate this image as a path in flex mxml, something like this:
<s:Path data="M 0 0 L 0 100 L 100 100 L 100 0 L 0 0" />
How can I export the path data so that I can use this shape in Flex, is there a program that will do this for me?
Illustrator will export an FXG, as will Photoshop.
My problem was that my original image was a flat file, not a path. This meant that following #www.Flextras.com's answer didn't work for me, the result was an FXG with an image embedded.
The process I used is as follows, I used Adobe Fireworks for this:
1) Magic wand selection
Select the body of the image with magic wand.
2) Convert to path
Right click -> Modify Marquee -> Convert to Path
3) Export as FXG
File -> Export
4) Done
Open the FXG in notepad and extract the path data.