0
$\begingroup$

i am struggling to get the desired cylinder in web using three js (cone in blender) which i made after manually mapping uv coordinates in blender.

As far as I know, at some point I just deleted the top and bottom faces and then re added them in blender but I guess that should not change the position of existing vertices and it should keep the cone straight as it comes when we add in blender.

enter image description here

and i also kept subdivision modifier as in this screenshot but that should also not be the problem. and when i export the obj file and import in three js in web, it rotates like this image which is the problem.

If i just add plain cone without any modification in uv or anything then it works fine though but i need to fix it in my current uv only as i just finished editing it and don't want to redo everything

$\endgroup$
4
  • $\begingroup$ Sorry, this is a Blender site. I do not know how three.js handles objects. In Blender default, objects are rotated around their origin. But you can change the pivot point to something else, the 3D cursor for example, but that is a setting within Blender how the tools operate, this will not be exported. What could be exported is where the origin is located relative to the world center. Now other software might not use the object's origin, but the world center. But I cannot really see where the origin is anyway, from the screenshot it could be the center of the object or on the surface. $\endgroup$ Commented Jun 13 at 6:45
  • $\begingroup$ The thing is i am not sure how uv mapping the object moved its rotation point around axis to somewhere else. I am trying to figure out that. If i just add cylinder and export then it is working fine. At firsy i only wanted to take uv mapping from blender and apply over the cylinder on three but that was too complex to get so now taking whole object from here. $\endgroup$ Commented Jun 13 at 6:52
  • 1
    $\begingroup$ UV mapping has nothing to do with the rotation point. At least not in any software I know. But as I said, this is a Blender site, not a three.js site - if three.js does weird things like that, you should ask somewhere specific to this software. $\endgroup$ Commented Jun 13 at 6:54
  • $\begingroup$ 2 things I would try: It looks like you have moved your cone from the World Origin, (little orange dot) if you did this in Object mode then perhaps you need to Apply this new location. to do this, in Object mode > select object > Ctrl A to open Apply menu and choose the All Transforms option. Other thing to try is to move object to World Origin. First move cursor, Object mode, Object menu >Snap > Cursor to World Origin. Next select object >Object menu > Set Origin > Origin to Geometry. Finally with object selected > Object menu > Snap > Selection to Cursor. $\endgroup$ Commented Jun 13 at 8:02

1 Answer 1

2
$\begingroup$

Try to re-center your cone. In the 3D view of your screenshot one can see it's translated in -y axis direction. The OBJ exporter writes the absolute position values of the vertices, so they are relative to the origin. I guess your three.js software is also simply using the origin as the center of the object, which results in the rotation you observe. To re-center you geometry, position it around the origin the way you want it and do in Object Mode Object > Apply > Location.

enter image description here

$\endgroup$
5
  • $\begingroup$ When you just position the mesh around the origin (which is not in the world center at the moment), then applying the location makes this all for the birds... because applying the location sets the origin to the world center without moving the mesh, i.e. afterwards it is no longer positioned around the origin as you did manually before. I guess you want to move the origin with the mesh to the world center, this is not done by applying the location but by clearing the location with Alt+G. Or you are mixing origin (of an object) with world origin (center) without differentiating. $\endgroup$ Commented Jun 13 at 9:45
  • $\begingroup$ I'm quite sure you mean the world center with origin regarding the fact that the OBJ exporter does not store individual object origins. But then I would suggest instead of manually moving the mesh to the world center, just right-clicking in Object Mode and choose Set Origin > Origin to Geometry (or Geometry to Origin, does not matter in this case) to get it centered (adjustments if this is not desired can then easily be made in relation to the centered origin) and then again, clearing the location with Alt+G. $\endgroup$ Commented Jun 13 at 9:53
  • 1
    $\begingroup$ @GordonBrinkmann i did not want to suggest Origin to Geometry because this will also alter the height of the object's pivot. I had the impression OP wanted the cone standing on the ground, so this seemed to me a beginnner friendly solution. $\endgroup$
    – taiyo
    Commented Jun 13 at 10:06
  • $\begingroup$ Okay, yeah I see what you mean. If I had thought about that I would have maybe suggested things like selecting the bottom edge, snapping the 3D cursor there, then the origin to the cursor, then clearing location. I agree this is a little less beginner friendly... but hey, we cannot protect them forever, one day they have to fledge to become better at modeling ;) By the way, as someone who only uses Blender I did not know this would be OBJ exported (didn't notice in the question)... FBX keeps individual origins which are not in the world center, so... $\endgroup$ Commented Jun 13 at 10:12
  • 1
    $\begingroup$ I like that attitude and I hope OP reads the comments carefully^^. $\endgroup$
    – taiyo
    Commented Jun 13 at 10:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .